libfly
6.2.2
C++20 utility library for Linux, macOS, and Windows
|
#include <styler.hpp>
Public Types | |
enum | StandardColor { Black , Red , Green , Yellow , Blue , Magenta , Cyan , White } |
enum | Plane { Foreground , Background } |
Public Member Functions | |
constexpr | Color (std::uint8_t color, Plane plane=Foreground) noexcept |
Public Attributes | |
const std::uint8_t | m_color |
const Plane | m_plane |
Struct to modify the foreground or background color of a std::ostream.
Constants for the plane that should be modified.
Constants for standard colors.
On Linux and macOS, a color may be any value in the range [0, 255]. While only the 8 standard colors are listed here, any 8-bit integer value may be cast to a color. The color values correspond to the ANSI 256-color lookup table:
https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit.
On Windows, the color may only be one of the 8 standard colors listed here.
|
inlineexplicitconstexprnoexcept |
Construct a Color as either a foreground or background color.
color | The 256-color value to apply. |
plane | The plane (default foreground) that should be modified. |