omw  0.2.0
Functions | Variables
omw::ansiesc::csi::sgr Namespace Reference

SGR (Select Graphic Rendition) More...

Functions

omw::string seq (const omw::string &argstr="")
 
omw::string seq (int param)
 
omw::string seq (int param, int arg0, int arg1)
 
omw::string seq (int param, int arg0, int arg1, int arg2, int arg3)
 
omw::string seq (const int *argv, size_t argc)
 
omw::string seq (const std::vector< int > &args)
 

Variables

constexpr int font_base = 10
 
constexpr int foreground_base = 30
 
constexpr int background_base = 40
 
constexpr int brightForeground_base = 90
 
constexpr int brightBackground_base = 100
 
constexpr int colorBlack = 0
 
constexpr int colorRed = 1
 
constexpr int colorGreen = 2
 
constexpr int colorYellow = 3
 
constexpr int colorBlue = 4
 
constexpr int colorMagenta = 5
 
constexpr int colorCyan = 6
 
constexpr int colorWhite = 7
 
Parameters
constexpr int reset = 0
 
constexpr int bold = 1
 
constexpr int faint = 2
 
constexpr int italic = 3
 
constexpr int underline = 4
 
constexpr int blinkSlow = 5
 
constexpr int blinkFast = 6
 
constexpr int reverseVideo = 7
 
constexpr int conceal = 8
 
constexpr int strike = 9
 
constexpr int defaultFont = font_base
 
constexpr int font0 = font_base + 0
 
constexpr int font1 = font_base + 1
 
constexpr int font2 = font_base + 2
 
constexpr int font3 = font_base + 3
 
constexpr int font4 = font_base + 4
 
constexpr int font5 = font_base + 5
 
constexpr int font6 = font_base + 6
 
constexpr int font7 = font_base + 7
 
constexpr int font8 = font_base + 8
 
constexpr int font9 = font_base + 9
 
constexpr int fraktur = 20
 
constexpr int boldFaintOff = 22
 
constexpr int boldOff = boldFaintOff
 
constexpr int faintOff = boldFaintOff
 
constexpr int italicFrakturOff = 23
 
constexpr int italicOff = italicFrakturOff
 
constexpr int frakturOff = italicFrakturOff
 
constexpr int underlineOff = 24
 
constexpr int blinkOff = 25
 
constexpr int reverseVideoOff = 27
 
constexpr int concealOff = 28
 
constexpr int reveal = concealOff
 
constexpr int strikeOff = 29
 
constexpr int fgColorBlack = foreground_base + colorBlack
 
constexpr int fgColorRed = foreground_base + colorRed
 
constexpr int fgColorGreen = foreground_base + colorGreen
 
constexpr int fgColorYellow = foreground_base + colorYellow
 
constexpr int fgColorBlue = foreground_base + colorBlue
 
constexpr int fgColorMagenta = foreground_base + colorMagenta
 
constexpr int fgColorCyan = foreground_base + colorCyan
 
constexpr int fgColorWhite = foreground_base + colorWhite
 
constexpr int setForeColor = 38
 
constexpr int defaultForeColor = 39
 
constexpr int fgColorDefault = defaultForeColor
 
constexpr int bgColorBlack = background_base + colorBlack
 
constexpr int bgColorRed = background_base + colorRed
 
constexpr int bgColorGreen = background_base + colorGreen
 
constexpr int bgColorYellow = background_base + colorYellow
 
constexpr int bgColorBlue = background_base + colorBlue
 
constexpr int bgColorMagenta = background_base + colorMagenta
 
constexpr int bgColorCyan = background_base + colorCyan
 
constexpr int bgColorWhite = background_base + colorWhite
 
constexpr int setBackColor = 48
 
constexpr int defaultBackColor = 49
 
constexpr int bgColorDefault = defaultBackColor
 
constexpr int framed = 51
 
constexpr int encircled = 52
 
constexpr int overlined = 53
 
constexpr int framedEncircledOff = 54
 
constexpr int framedOff = framedEncircledOff
 
constexpr int encircledOff = framedEncircledOff
 
constexpr int overlinedOff = 55
 
constexpr int setUnderlineColor = 58
 
constexpr int defaultUnderlineColor = 59
 
constexpr int super = 73
 
constexpr int sub = 74
 
constexpr int superSubOff = 75
 
constexpr int superOff = superSubOff
 
constexpr int subOff = superSubOff
 
constexpr int fgColorBrightBlack = brightForeground_base + colorBlack
 
constexpr int fgColorBrightRed = brightForeground_base + colorRed
 
constexpr int fgColorBrightGreen = brightForeground_base + colorGreen
 
constexpr int fgColorBrightYellow = brightForeground_base + colorYellow
 
constexpr int fgColorBrightBlue = brightForeground_base + colorBlue
 
constexpr int fgColorBrightMagenta = brightForeground_base + colorMagenta
 
constexpr int fgColorBrightCyan = brightForeground_base + colorCyan
 
constexpr int fgColorBrightWhite = brightForeground_base + colorWhite
 
constexpr int bgColorBrightBlack = brightBackground_base + colorBlack
 
constexpr int bgColorBrightRed = brightBackground_base + colorRed
 
constexpr int bgColorBrightGreen = brightBackground_base + colorGreen
 
constexpr int bgColorBrightYellow = brightBackground_base + colorYellow
 
constexpr int bgColorBrightBlue = brightBackground_base + colorBlue
 
constexpr int bgColorBrightMagenta = brightBackground_base + colorMagenta
 
constexpr int bgColorBrightCyan = brightBackground_base + colorCyan
 
constexpr int bgColorBrightWhite = brightBackground_base + colorWhite
 
Arguments

Used as arg0 in the seq() functions.

constexpr int setColor_8bit = 5
 
constexpr int setColor_rgb = 2
 
8-bit Colors

See color table on Wikipedia.

constexpr int col8bit_standardBlack = 0
 
constexpr int col8bit_standardBlue = 1
 
constexpr int col8bit_standardCyan = 2
 
constexpr int col8bit_standardGreen = 3
 
constexpr int col8bit_standardMagenta = 4
 
constexpr int col8bit_standardRed = 5
 
constexpr int col8bit_standardWhite = 6
 
constexpr int col8bit_standardYellow = 7
 
constexpr int col8bit_brightBlack = 8
 
constexpr int col8bit_brightBlue = 9
 
constexpr int col8bit_brightCyan = 10
 
constexpr int col8bit_brightGreen = 11
 
constexpr int col8bit_brightMagenta = 12
 
constexpr int col8bit_brightRed = 13
 
constexpr int col8bit_brightWhite = 14
 
constexpr int col8bit_brightYellow = 15
 
constexpr int col8bit_grayscale [24]
 
constexpr int col8bit_fullGrayscale [26]
 

Detailed Description

SGR (Select Graphic Rendition)

Function Documentation

◆ seq() [1/6]

omw::string omw::ansiesc::csi::sgr::seq ( const int *  argv,
size_t  argc 
)
Parameters
argvParameters and arguments of the sequence
argcNumber of elemets

Builds a composed SGR escape sequence: ESC [ <argv[0]> ; <argv[1]> ; ... ; <argv[argc - 1]> m.

Examples:

const int sgr1[] = { 38, 5, 33, 1 };
std::cout << omw::ansiesc::csi::sgr::seq(sgr1, 4) << "this text will be bold and light blue" << std::endl;
const int sgr2[] = { 0, 96, 7 };
std::cout << omw::ansiesc::csi::sgr::seq(sgr2, 3) << "this text will be black on bright cyan" << omw::normal << std::endl;

◆ seq() [2/6]

omw::string omw::ansiesc::csi::sgr::seq ( const omw::string argstr = "")
Parameters
argstrThe argument(s) of the sequence

Builds a SGR escape sequence: ESC [ <argstr> m.

An empty argument string is allowed, it is treated as the reset sequence by the terminal.

◆ seq() [3/6]

omw::string omw::ansiesc::csi::sgr::seq ( const std::vector< int > &  args)
Parameters
argsParameters and arguments of the sequence

Builds a composed SGR escape sequence: ESC [ <args[0]> ; <args[1]> ; ... ; <args[args.size() - 1]> m.

See seq(const int*, size_t).

◆ seq() [4/6]

omw::string omw::ansiesc::csi::sgr::seq ( int  param)
Parameters
paramThe SGR parameter

Builds a SGR escape sequence: ESC [ <param> m.

◆ seq() [5/6]

omw::string omw::ansiesc::csi::sgr::seq ( int  param,
int  arg0,
int  arg1 
)
Parameters
paramThe SGR parameter
arg0The 1st argument of the sequence
arg1The 2nd argument of the sequence

Builds a SGR escape sequence: ESC [ <param> ; <arg0> ; <arg1> m.

◆ seq() [6/6]

omw::string omw::ansiesc::csi::sgr::seq ( int  param,
int  arg0,
int  arg1,
int  arg2,
int  arg3 
)
Parameters
paramThe SGR parameter
arg0The 1st argument of the sequence
arg1The 2nd argument of the sequence
arg2The 3rd argument of the sequence
arg3The 4th argument of the sequence

Builds a SGR escape sequence: ESC [ <param> ; <arg0> ; <arg1> ; <arg2> ; <arg3> m.

Variable Documentation

◆ col8bit_fullGrayscale

constexpr int omw::ansiesc::csi::sgr::col8bit_fullGrayscale[26]
constexpr
Initial value:
=
{
16, 232, 233, 234, 235, 236, 237, 238,
239, 240, 241, 242, 243, 244, 245, 246,
247, 248, 249, 250, 251, 252, 253, 254,
255, 231
}

Grayscale including black and white.

◆ col8bit_grayscale

constexpr int omw::ansiesc::csi::sgr::col8bit_grayscale[24]
constexpr
Initial value:
=
{
232, 233, 234, 235, 236, 237, 238, 239,
240, 241, 242, 243, 244, 245, 246, 247,
248, 249, 250, 251, 252, 253, 254, 255
}

Grayscale from black to white in 24 steps, excluding black and white.

omw::ansiesc::csi::sgr::seq
omw::string seq(const omw::string &argstr="")
Definition: cli.cpp:163