4#ifndef FTXUI_SCREEN_COLOR_HPP
5#define FTXUI_SCREEN_COLOR_HPP
28class FTXUI_EXPORT(SCREEN) Color {
30 enum Palette1 : uint8_t;
31 enum Palette16 : uint8_t;
32 enum Palette256 : uint8_t;
39 Color(Palette1 index);
40 Color(Palette16 index);
41 Color(Palette256 index);
43 Color(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha = 255);
44 static Color RGB(uint8_t red, uint8_t green, uint8_t blue);
45 static Color HSV(uint8_t hue, uint8_t saturation, uint8_t value);
46 static Color RGBA(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha);
47 static Color HSVA(uint8_t hue,
51 static Color Interpolate(
float t,
const Color& a,
const Color& b);
52 static Color Blend(
const Color& lhs,
const Color& rhs);
58 enum Palette1 : uint8_t{
62 enum Palette16 : uint8_t {
109 DarkOliveGreen1 = 191,
110 DarkOliveGreen1Bis = 192,
111 DarkOliveGreen2 = 155,
112 DarkOliveGreen3 = 107,
113 DarkOliveGreen3Bis = 113,
114 DarkOliveGreen3Ter = 149,
117 DarkOrange3Bis = 166,
122 DarkSeaGreen1Bis = 193,
124 DarkSeaGreen2Bis = 157,
126 DarkSeaGreen3Bis = 150,
128 DarkSeaGreen4Bis = 71,
129 DarkSlateGray1 = 123,
131 DarkSlateGray3 = 116,
146 DeepSkyBlue3Bis = 32,
148 DeepSkyBlue4Bis = 24,
149 DeepSkyBlue4Ter = 25,
207 LightGoldenrod1 = 227,
208 LightGoldenrod2 = 186,
209 LightGoldenrod2Bis = 221,
210 LightGoldenrod2Ter = 222,
211 LightGoldenrod3 = 179,
219 LightSalmon3Bis = 173,
223 LightSkyBlue3Bis = 110,
224 LightSlateBlue = 105,
225 LightSlateGrey = 103,
226 LightSteelBlue = 147,
227 LightSteelBlue1 = 189,
228 LightSteelBlue3 = 146,
238 MediumOrchid1Bis = 207,
243 MediumPurple2Bis = 140,
245 MediumPurple3Bis = 98,
247 MediumSpringGreen = 49,
248 MediumTurquoise = 80,
249 MediumVioletRed = 126,
267 PaleTurquoise1 = 159,
269 PaleVioletRed1 = 211,
300 SpringGreen2Bis = 47,
302 SpringGreen3Bis = 41,
326 bool operator==(
const Color& rhs)
const;
327 bool operator!=(
const Color& rhs)
const;
329 std::string Print(
bool is_background_color)
const;
330 void PrintTo(std::string& out,
bool is_background_color)
const;
331 void PrintTo(std::string& out,
332 bool is_background_color,
333 Terminal::Color color_support)
const;
334 bool IsOpaque()
const {
return alpha_ == 255; }
338 uint8_t GetRed()
const;
339 uint8_t GetGreen()
const;
340 uint8_t GetBlue()
const;
341 uint8_t GetAlpha()
const;
344 enum class ColorType : uint8_t {
350 ColorType type_ = ColorType::Palette1;
361FTXUI_EXPORT(SCREEN) Color
operator""_rgb(
unsigned long long int combined);
#define FTXUI_EXPORT(component)
Color
Color is an enumeration that represents the color support of the terminal.
The FTXUI ftxui::Terminal:: namespace.
The FTXUI ftxui:: namespace.
The FTXUI ftxui::literals:: namespace.