|
CPGen
C++ project generator
|
ANSI SGR (Select Graphic Rendition) code constants and escape sequence builder. More...
Functions | |
| std::string | esc (const char *code) |
| Build a complete ANSI SGR escape sequence from a code string. | |
Variables | |
Standard foreground colours | |
| constexpr const char * | FG_BLACK = "30" |
| Black foreground. | |
| constexpr const char * | FG_RED = "31" |
| Red foreground. | |
| constexpr const char * | FG_GREEN = "32" |
| Green foreground. | |
| constexpr const char * | FG_YELLOW = "33" |
| Yellow foreground. | |
| constexpr const char * | FG_BLUE = "34" |
| Blue foreground. | |
| constexpr const char * | FG_MAGENTA = "35" |
| Magenta foreground. | |
| constexpr const char * | FG_CYAN = "36" |
| Cyan foreground. | |
| constexpr const char * | FG_WHITE = "37" |
| White foreground. | |
Bright / light foreground colours | |
| constexpr const char * | FG_BBLACK |
| Bright black (dark grey) foreground. | |
| constexpr const char * | FG_BRED = "91" |
| Bright red foreground. | |
| constexpr const char * | FG_BGREEN = "92" |
| Bright green foreground. | |
| constexpr const char * | FG_BYELLOW = "93" |
| Bright yellow foreground. | |
| constexpr const char * | FG_BBLUE = "94" |
| Bright blue foreground. | |
| constexpr const char * | FG_BMAGENTA = "95" |
| Bright magenta foreground. | |
| constexpr const char * | FG_BCYAN = "96" |
| Bright cyan foreground. | |
| constexpr const char * | FG_BWHITE = "97" |
| Bright white foreground. | |
Standard background colours | |
| constexpr const char * | BG_BLACK = "40" |
| Black background. | |
| constexpr const char * | BG_RED = "41" |
| Red background. | |
| constexpr const char * | BG_GREEN = "42" |
| Green background. | |
| constexpr const char * | BG_YELLOW = "43" |
| Yellow background. | |
| constexpr const char * | BG_BLUE = "44" |
| Blue background. | |
| constexpr const char * | BG_MAGENTA = "45" |
| Magenta background. | |
| constexpr const char * | BG_CYAN = "46" |
| Cyan background. | |
| constexpr const char * | BG_WHITE = "47" |
| White background. | |
Bright / light background colours | |
| constexpr const char * | BG_BBLACK = "100" |
| Bright black background. | |
| constexpr const char * | BG_BRED = "101" |
| Bright red background. | |
| constexpr const char * | BG_BGREEN = "102" |
| Bright green background. | |
| constexpr const char * | BG_BYELLOW = "103" |
| Bright yellow background. | |
| constexpr const char * | BG_BBLUE = "104" |
| Bright blue background. | |
| constexpr const char * | BG_BMAGENTA |
| Bright magenta background. | |
| constexpr const char * | BG_BCYAN = "106" |
| Bright cyan background. | |
| constexpr const char * | BG_BWHITE = "107" |
| Bright white background. | |
Text style modifiers | |
| constexpr const char * | RESET = "0" |
| Reset all attributes. | |
| constexpr const char * | BOLD = "1" |
| Bold / increased intensity. | |
| constexpr const char * | DIM = "2" |
| Dim / decreased intensity. | |
| constexpr const char * | ITALIC = "3" |
| Italic. | |
| constexpr const char * | UNDERLINE = "4" |
| Underline. | |
| constexpr const char * | BLINK = "5" |
| Slow blink. | |
| constexpr const char * | INVERSE = "7" |
| Reverse video (swap FG/BG). | |
| constexpr const char * | HIDDEN = "8" |
| Conceal / invisible. | |
| constexpr const char * | STRIKETHRU = "9" |
| Strikethrough. | |
ANSI SGR (Select Graphic Rendition) code constants and escape sequence builder.
Each constant is the numeric SGR parameter string (without the surrounding ESC[…m). Pass them to esc to get a ready-to-print escape sequence.
|
inline |
Build a complete ANSI SGR escape sequence from a code string.
Wraps code in the standard ESC [ … m envelope so it can be embedded directly in output strings.
"\\033[32m"). 
|
inlineconstexpr |
Bright black background.
|
inlineconstexpr |
Bright blue background.
|
inlineconstexpr |
Bright cyan background.
|
inlineconstexpr |
Bright green background.
|
inlineconstexpr |
Black background.
|
inlineconstexpr |
Blue background.
|
inlineconstexpr |
Bright magenta background.
|
inlineconstexpr |
Bright red background.
|
inlineconstexpr |
Bright white background.
|
inlineconstexpr |
Bright yellow background.
|
inlineconstexpr |
Cyan background.
|
inlineconstexpr |
Green background.
|
inlineconstexpr |
Magenta background.
|
inlineconstexpr |
Red background.
|
inlineconstexpr |
White background.
|
inlineconstexpr |
Yellow background.
|
inlineconstexpr |
Slow blink.
|
inlineconstexpr |
Bold / increased intensity.
|
inlineconstexpr |
Dim / decreased intensity.
|
inlineconstexpr |
Bright black (dark grey) foreground.
|
inlineconstexpr |
Bright blue foreground.
|
inlineconstexpr |
Bright cyan foreground.
|
inlineconstexpr |
Bright green foreground.
|
inlineconstexpr |
Black foreground.
|
inlineconstexpr |
Blue foreground.
|
inlineconstexpr |
Bright magenta foreground.
|
inlineconstexpr |
Bright red foreground.
|
inlineconstexpr |
Bright white foreground.
|
inlineconstexpr |
Bright yellow foreground.
|
inlineconstexpr |
Cyan foreground.
|
inlineconstexpr |
Green foreground.
|
inlineconstexpr |
Magenta foreground.
|
inlineconstexpr |
Red foreground.
|
inlineconstexpr |
White foreground.
|
inlineconstexpr |
Yellow foreground.
|
inlineconstexpr |
Conceal / invisible.
|
inlineconstexpr |
Reverse video (swap FG/BG).
|
inlineconstexpr |
Italic.
|
inlineconstexpr |
Reset all attributes.
|
inlineconstexpr |
Strikethrough.
|
inlineconstexpr |
Underline.