41 ColorLevel color_level();
48 void set_color_level(ColorLevel level);
54 void disable_colors();
57 bool are_colors_enabled();
118 std::string
foreground(std::uint8_t r, std::uint8_t g, std::uint8_t b);
120 std::string
background(std::uint8_t r, std::uint8_t g, std::uint8_t b);
ColorLevel
The possible levels of terminal color support.
@ TrueColor
24-bit RGB truecolor, \x1b[38;2;r;g;bm.
@ NoColor
No color support, plain ASCII output only.
@ Basic
ANSI/16 colors (basic SGR codes), \x1b[3Xm.
@ ANSI256
256-color palette (16 ANSI + 216-color cube + 24 grayscale), \x1b[38;5;Nm.
24-bit RGB truecolor escape sequences (\x1b[38;2;r;g;bm / \x1b[48;2;r;g;bm).
std::string foreground(std::uint8_t r, std::uint8_t g, std::uint8_t b)
Escape sequence to set the given RGB foreground text color.
std::string background(std::uint8_t r, std::uint8_t g, std::uint8_t b)
Escape sequence to set the given RGB background color.
256-color palette escape sequences (\x1b[38;5;Nm / \x1b[48;5;Nm).
std::string background(std::uint8_t index)
Escape sequence to set the given palette index as background color.
std::string foreground(std::uint8_t index)
Escape sequence to set the given palette index as foreground text color.
8 bit 8-color palette escape sequences.
const char * red()
Escape sequence to set red text color.
const char * green()
Escape sequence to set green text color.
const char * black()
Escape sequence to set black text color.
const char * white()
Escape sequence to set white text color.
const char * magenta()
Escape sequence to set magenta (pink) text color.
const char * cyan()
Escape sequence to set cyan text color.
const char * blue()
Escape sequence to set blue text color.
const char * yellow()
Escape sequence to set yellow text color.
Terminal text styling escape sequences (bold, faint, underline, blink, reset).
const char * blink()
escape sequence to set blinking text formatting.
const char * reset()
escape sequence to reset the terminal text formatting.
const char * bold()
escape sequence to set bold text formatting.
const char * underline()
escape sequence to set underlined text formatting.
const char * faint()
escape sequence to set faint (dim) text formatting.