Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
term_colors.hpp File Reference
#include "sham/term/color.hpp"
#include <cstdint>
#include <string>
Include dependency graph for term_colors.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  shambase
 namespace for basic c++ utilities

Functions

void shambase::term_colors::enable_colors ()
 Enable colors in logs.
void shambase::term_colors::disable_colors ()
 Disable all colors.
bool shambase::term_colors::colors_enabled ()
 Are colors enabled.
sham::term::ColorLevel shambase::term_colors::color_level ()
 Get the detected/forced terminal color support level.
const std::string shambase::term_colors::empty ()
 Get the empty terminal escape.
const std::string shambase::term_colors::reset ()
 Get the reset terminal escape char.
const std::string shambase::term_colors::bold ()
 Get the bold terminal escape char.
const std::string shambase::term_colors::faint ()
 Get the faint terminal escape char.
const std::string shambase::term_colors::underline ()
 Get the underline terminal escape char.
const std::string shambase::term_colors::blink ()
 Get the blink terminal escape char.
const std::string shambase::term_colors::col8b_black ()
 Get the black terminal escape char.
const std::string shambase::term_colors::col8b_red ()
 Get the red terminal escape char.
const std::string shambase::term_colors::col8b_green ()
 Get the green terminal escape char.
const std::string shambase::term_colors::col8b_yellow ()
 Get the yellow terminal escape char.
const std::string shambase::term_colors::col8b_blue ()
 Get the blue terminal escape char.
const std::string shambase::term_colors::col8b_magenta ()
 Get the magenta (pink) terminal escape char.
const std::string shambase::term_colors::col8b_cyan ()
 Get the cyan terminal escape char.
const std::string shambase::term_colors::col8b_white ()
 Get the white terminal escape char.
std::string shambase::term_colors::col256_foreground (std::uint8_t index)
 Get the 256-color palette foreground terminal escape char (empty if unsupported).
std::string shambase::term_colors::col256_background (std::uint8_t index)
 Get the 256-color palette background terminal escape char (empty if unsupported).
std::string shambase::term_colors::rgb_foreground (std::uint8_t r, std::uint8_t g, std::uint8_t b)
 Get the 24-bit RGB truecolor foreground terminal escape char (empty if unsupported).
std::string shambase::term_colors::rgb_background (std::uint8_t r, std::uint8_t g, std::uint8_t b)
 Get the 24-bit RGB truecolor background terminal escape char (empty if unsupported).

Detailed Description

Author
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)

Definition in file term_colors.hpp.

Function Documentation

◆ blink()

const std::string shambase::term_colors::blink ( )
inline

Get the blink terminal escape char.

Definition at line 49 of file term_colors.hpp.

Here is the call graph for this function:

◆ bold()

const std::string shambase::term_colors::bold ( )
inline

Get the bold terminal escape char.

Definition at line 43 of file term_colors.hpp.

Here is the call graph for this function:

◆ col256_background()

std::string shambase::term_colors::col256_background ( std::uint8_t index)
inline

Get the 256-color palette background terminal escape char (empty if unsupported).

Definition at line 73 of file term_colors.hpp.

Here is the call graph for this function:

◆ col256_foreground()

std::string shambase::term_colors::col256_foreground ( std::uint8_t index)
inline

Get the 256-color palette foreground terminal escape char (empty if unsupported).

Definition at line 68 of file term_colors.hpp.

Here is the call graph for this function:

◆ col8b_black()

const std::string shambase::term_colors::col8b_black ( )
inline

Get the black terminal escape char.

Definition at line 51 of file term_colors.hpp.

Here is the call graph for this function:

◆ col8b_blue()

const std::string shambase::term_colors::col8b_blue ( )
inline

Get the blue terminal escape char.

Definition at line 59 of file term_colors.hpp.

Here is the call graph for this function:

◆ col8b_cyan()

const std::string shambase::term_colors::col8b_cyan ( )
inline

Get the cyan terminal escape char.

Definition at line 63 of file term_colors.hpp.

Here is the call graph for this function:

◆ col8b_green()

const std::string shambase::term_colors::col8b_green ( )
inline

Get the green terminal escape char.

Definition at line 55 of file term_colors.hpp.

Here is the call graph for this function:

◆ col8b_magenta()

const std::string shambase::term_colors::col8b_magenta ( )
inline

Get the magenta (pink) terminal escape char.

Definition at line 61 of file term_colors.hpp.

Here is the call graph for this function:

◆ col8b_red()

const std::string shambase::term_colors::col8b_red ( )
inline

Get the red terminal escape char.

Definition at line 53 of file term_colors.hpp.

Here is the call graph for this function:

◆ col8b_white()

const std::string shambase::term_colors::col8b_white ( )
inline

Get the white terminal escape char.

Definition at line 65 of file term_colors.hpp.

Here is the call graph for this function:

◆ col8b_yellow()

const std::string shambase::term_colors::col8b_yellow ( )
inline

Get the yellow terminal escape char.

Definition at line 57 of file term_colors.hpp.

Here is the call graph for this function:

◆ color_level()

sham::term::ColorLevel shambase::term_colors::color_level ( )
inline

Get the detected/forced terminal color support level.

Definition at line 36 of file term_colors.hpp.

◆ colors_enabled()

bool shambase::term_colors::colors_enabled ( )
inline

Are colors enabled.

Definition at line 33 of file term_colors.hpp.

◆ disable_colors()

void shambase::term_colors::disable_colors ( )
inline

Disable all colors.

Definition at line 30 of file term_colors.hpp.

◆ empty()

const std::string shambase::term_colors::empty ( )
inline

Get the empty terminal escape.

Definition at line 39 of file term_colors.hpp.

◆ enable_colors()

void shambase::term_colors::enable_colors ( )
inline

Enable colors in logs.

Definition at line 27 of file term_colors.hpp.

◆ faint()

const std::string shambase::term_colors::faint ( )
inline

Get the faint terminal escape char.

Definition at line 45 of file term_colors.hpp.

Here is the call graph for this function:

◆ reset()

const std::string shambase::term_colors::reset ( )
inline

Get the reset terminal escape char.

Definition at line 41 of file term_colors.hpp.

Here is the call graph for this function:

◆ rgb_background()

std::string shambase::term_colors::rgb_background ( std::uint8_t r,
std::uint8_t g,
std::uint8_t b )
inline

Get the 24-bit RGB truecolor background terminal escape char (empty if unsupported).

Definition at line 83 of file term_colors.hpp.

Here is the call graph for this function:

◆ rgb_foreground()

std::string shambase::term_colors::rgb_foreground ( std::uint8_t r,
std::uint8_t g,
std::uint8_t b )
inline

Get the 24-bit RGB truecolor foreground terminal escape char (empty if unsupported).

Definition at line 78 of file term_colors.hpp.

Here is the call graph for this function:

◆ underline()

const std::string shambase::term_colors::underline ( )
inline

Get the underline terminal escape char.

Definition at line 47 of file term_colors.hpp.

Here is the call graph for this function: