2#include "terminalpp/core.hpp"
12inline constexpr byte no_attributes = 0;
15inline constexpr byte bold = 1;
16inline constexpr byte faint = 2;
17inline constexpr byte normal_intensity = 22;
20inline constexpr byte underlined = 4;
21inline constexpr byte not_underlined = 24;
24inline constexpr byte blinking = 5;
25inline constexpr byte steady = 25;
28inline constexpr byte negative_polarity = 7;
29inline constexpr byte positive_polarity = 27;
32inline constexpr byte foreground_colour_base = 30;
33inline constexpr byte background_colour_base = 40;
35inline constexpr byte colour_black = 0;
36inline constexpr byte colour_red = 1;
37inline constexpr byte colour_green = 2;
38inline constexpr byte colour_yellow = 3;
39inline constexpr byte colour_blue = 4;
40inline constexpr byte colour_magenta = 5;
41inline constexpr byte colour_cyan = 6;
42inline constexpr byte colour_white = 7;
43inline constexpr byte colour_default = 9;
52inline constexpr byte high_colour_offset = 16;
55inline constexpr auto red_coefficient = 36;
56inline constexpr auto green_coefficient = 6;
57inline constexpr auto blue_coefficient = 1;
64 return high_colour_offset + (red * red_coefficient)
65 + (green * green_coefficient) + (blue * blue_coefficient);
73 return (value - high_colour_offset) / red_coefficient;
81 return ((value - high_colour_offset) % red_coefficient) / green_coefficient;
89 return (value - high_colour_offset) % green_coefficient;
96inline constexpr byte greyscale_colour_offset = 232;
103 return greyscale_colour_offset + grey;
111 return value - greyscale_colour_offset;
Contains constants for the Select Graphics Rendition command parameters.
constexpr byte encode_greyscale_component(byte grey) noexcept
Encode a greyscale value.
Definition graphics.hpp:101
constexpr byte encode_high_components(byte red, byte green, byte blue) noexcept
Encode an RGB value.
Definition graphics.hpp:62
constexpr byte high_green_component(byte value) noexcept
Extract the green component of a high colour value.
Definition graphics.hpp:79
constexpr byte high_red_component(byte value) noexcept
Extract the red component of a high colour value.
Definition graphics.hpp:71
constexpr byte greyscale_component(byte value) noexcept
Extract a greyscale value.
Definition graphics.hpp:109
constexpr byte high_blue_component(byte value) noexcept
Extract the blue component of a high colour value.
Definition graphics.hpp:87