|
enum class | Attr : std::uint8_t { Unchanged
, Normal
, Bright
, Reverse
} |
| Color attributes. More...
|
enum class | Fg : std::uint8_t {
Unchanged
, Default
, Black
, Red
,
Green
, Yellow
, Blue
, Magenta
,
Cyan
, White
} |
| Foreground colors. More...
|
enum class | Bg : std::uint8_t {
Unchanged
, Default
, Black
, Red
,
Green
, Yellow
, Blue
, Magenta
,
Cyan
, White
} |
| Backgroud colors. More...
|
enum | Constant : std::uint8_t {
Black
, BrightBlack
, Red
, BrightRed
,
Green
, BrightGreen
, Yellow
, BrightYellow
,
Blue
, BrightBlue
, Magenta
, BrightMagenta
,
Cyan
, BrightCyan
, White
, BrightWhite
,
Default
, BrightDefault
} |
| Predefined (foregreound) color contants Intentionally not an enum class, so it can be used as Color::Red , Color::Default , etc. More...
|
using | UidType = std::uint32_t |
| Color unique id type.
|
|
| Color () |
| Default ctor: terminal default color.
|
| Color (Attr attr_r, Fg fg_r=Fg::Unchanged, Bg bg_r=Bg::Unchanged) |
| Color (Attr attr_r, Bg bg_r) |
| Color (Fg fg_r, Bg bg_r=Bg::Unchanged) |
| Color (Bg bg_r) |
| Color (Constant color_r, Bg bg_r=Bg::Default) |
| Color constant combined with background (Bg::Default)
|
template<class CCC_, typename = EnableIfCustomColorCtor<CCC_>> |
| Color (CCC_ &&color_r) |
| Custom ctor from ColorTraits enabled type.
|
| operator bool () const |
| Evaluate in boolean context (not nocolor)
|
Color & | operator<= (Color rhs) |
| Update Color (assign components which are not Unchanged in rhs )
|
Color & | operator<= (Color::Attr rhs) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
Color & | operator<= (Color::Fg rhs) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
Color & | operator<= (Color::Bg rhs) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
Color & | operator<= (Color::Constant rhs) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
Color | operator< (Color rhs) const |
| Return updated color.
|
Color | operator< (Color::Attr rhs) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
Color | operator< (Color::Fg rhs) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
Color | operator< (Color::Bg rhs) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
Color | operator< (Color::Constant rhs) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
Attr | attr () const |
Color & | attr (Attr attr_r) |
Fg | fg () const |
Color & | fg (Fg fg_r) |
Bg | bg () const |
Color & | bg (Bg bg_r) |
UidType | uid () const |
| Each color has a unique numeric id.
|
const std::string & | str () const |
| The colors SGRsequence if do_colors is true .
|
std::string | debugstr () const |
| The colors SGRsequence human readable.
|
Various ways to define ansi SGR sequences.
Any color component (Attr, Fg, Bg) may have the value Uchanged
, indicating that this component should remain unchanged when the terminal color is set. To mimic this use operator<<= which updates a color by omitting Unchanged
components. nocolor
- Note
- The function do_colors determines if ansi SGR sequences are generated for colors at all.
Definition at line 172 of file ansi.h.