|
SlHelpers
|
Colorized output. More...
#include <Color.h>
Public Types | |
| enum | C : unsigned { BLACK = 30 , RED = 31 , GREEN = 32 , YELLOW = 33 , BLUE = 34 , MAGENTA = 35 , CYAN = 36 , WHITE = 37 , COL256 = 38 , DEFAULT = 39 } |
| Predefined colors. | |
| enum | Ctrl { NoNL , NL } |
| Controls for Color. | |
Public Member Functions | |
| Color (enum C c=DEFAULT) noexcept | |
New Color stream (stdout) using color c. | |
| Color (std::ostream &os, enum C c=DEFAULT) noexcept | |
New Color stream (into os) using color c. | |
| Color (unsigned char r, unsigned char g, unsigned char b) noexcept | |
| New Color stream (stdout) using an RGB color. | |
| Color (std::ostream &os, unsigned char r, unsigned char g, unsigned char b) noexcept | |
New Color stream (into os) using an RGB color. | |
| std::ostream & | os () |
| Return current output stream. | |
| void | ctrl (Ctrl ctrl) |
| Controls the stream behavior. | |
Static Public Member Functions | |
| static void | forceColor (bool force) |
| Force color value (see forceColorValue()). | |
| static void | forceColorValue (bool value) |
If forceColor(true) was called, use of colors is bound to value. | |
Friends | |
| void | testColor () |
|
inlineexplicitnoexcept |
|
inlineexplicitnoexcept |
|
inlinenoexcept |
New Color stream (stdout) using an RGB color.
| r | Red |
| g | Green |
| b | Blue |
|
inlinenoexcept |
New Color stream (into os) using an RGB color.
| os | Output stream where to output |
| r | Red |
| g | Green |
| b | Blue |
|
inline |
Controls the stream behavior.
| ctrl | Control character (like NoNL to not automatically emit a newline at the end) |
|
inlinestatic |
Force color value (see forceColorValue()).
| force | If set, use of colors is bound to color value set by forceColorValue() |
|
inlinestatic |
If forceColor(true) was called, use of colors is bound to value.
| value | If colors should be used |
|
inline |
Return current output stream.