Skip to content
You are viewing documentation for v6.1.3. Switch to latest (main).

ftxui::Color ​

cpp
#include <ftxui/screen/color.hpp>

A class representing terminal colors.

Examples: component/button_animated, component/button_in_frame, component/button_style, component/canvas_animated, component/dropdown_custom, component/flexbox_gallery, component/focus, component/homescreen, component/input_style, component/linear_gradient_gallery, component/maybe, component/menu_entries (+20 more)

Summary ​

SymbolDescription
Palette1
Palette16
Palette256
operator==
operator!=
Print
IsOpaque
Interpolate
BlendBlend two colors together using the alpha channel.

Public Types ​

Palette1 ​

cpp
enum Palette1 { Default };

Palette16 ​

cpp
enum Palette16 { Black, Red, Green, Yellow, Blue, Magenta, Cyan, GrayLight, GrayDark, RedLight, GreenLight, YellowLight, BlueLight, MagentaLight, CyanLight, White };

Palette256 ​

cpp
enum Palette256 { Aquamarine1, Aquamarine1Bis, Aquamarine3, Blue1, Blue3, Blue3Bis, BlueViolet, CadetBlue, CadetBlueBis, Chartreuse1, Chartreuse2, Chartreuse2Bis, Chartreuse3, Chartreuse3Bis, Chartreuse4, CornflowerBlue, Cornsilk1, Cyan1, Cyan2, Cyan3, DarkBlue, DarkCyan, DarkGoldenrod, DarkGreen, DarkKhaki, DarkMagenta, DarkMagentaBis, DarkOliveGreen1, DarkOliveGreen1Bis, DarkOliveGreen2, DarkOliveGreen3, DarkOliveGreen3Bis, DarkOliveGreen3Ter, DarkOrange, DarkOrange3, DarkOrange3Bis, DarkRed, DarkRedBis, DarkSeaGreen, DarkSeaGreen1, DarkSeaGreen1Bis, DarkSeaGreen2, DarkSeaGreen2Bis, DarkSeaGreen3, DarkSeaGreen3Bis, DarkSeaGreen4, DarkSeaGreen4Bis, DarkSlateGray1, DarkSlateGray2, DarkSlateGray3, DarkTurquoise, DarkViolet, DarkVioletBis, DeepPink1, DeepPink1Bis, DeepPink2, DeepPink3, DeepPink3Bis, DeepPink4, DeepPink4Bis, DeepPink4Ter, DeepSkyBlue1, DeepSkyBlue2, DeepSkyBlue3, DeepSkyBlue3Bis, DeepSkyBlue4, DeepSkyBlue4Bis, DeepSkyBlue4Ter, DodgerBlue1, DodgerBlue2, DodgerBlue3, Gold1, Gold3, Gold3Bis, Green1, Green3, Green3Bis, Green4, GreenYellow, Grey0, Grey100, Grey11, Grey15, Grey19, Grey23, Grey27, Grey3, Grey30, Grey35, Grey37, Grey39, Grey42, Grey46, Grey50, Grey53, Grey54, Grey58, Grey62, Grey63, Grey66, Grey69, Grey7, Grey70, Grey74, Grey78, Grey82, Grey84, Grey85, Grey89, Grey93, Honeydew2, HotPink, HotPink2, HotPink3, HotPink3Bis, HotPinkBis, IndianRed, IndianRed1, IndianRed1Bis, IndianRedBis, Khaki1, Khaki3, LightCoral, LightCyan1Bis, LightCyan3, LightGoldenrod1, LightGoldenrod2, LightGoldenrod2Bis, LightGoldenrod2Ter, LightGoldenrod3, LightGreen, LightGreenBis, LightPink1, LightPink3, LightPink4, LightSalmon1, LightSalmon3, LightSalmon3Bis, LightSeaGreen, LightSkyBlue1, LightSkyBlue3, LightSkyBlue3Bis, LightSlateBlue, LightSlateGrey, LightSteelBlue, LightSteelBlue1, LightSteelBlue3, LightYellow3, Magenta1, Magenta2, Magenta2Bis, Magenta3, Magenta3Bis, Magenta3Ter, MediumOrchid, MediumOrchid1, MediumOrchid1Bis, MediumOrchid3, MediumPurple, MediumPurple1, MediumPurple2, MediumPurple2Bis, MediumPurple3, MediumPurple3Bis, MediumPurple4, MediumSpringGreen, MediumTurquoise, MediumVioletRed, MistyRose1, MistyRose3, NavajoWhite1, NavajoWhite3, NavyBlue, Orange1, Orange3, Orange4, Orange4Bis, OrangeRed1, Orchid, Orchid1, Orchid2, PaleGreen1, PaleGreen1Bis, PaleGreen3, PaleGreen3Bis, PaleTurquoise1, PaleTurquoise4, PaleVioletRed1, Pink1, Pink3, Plum1, Plum2, Plum3, Plum4, Purple, Purple3, Purple4, Purple4Bis, PurpleBis, Red1, Red3, Red3Bis, RosyBrown, RoyalBlue1, Salmon1, SandyBrown, SeaGreen1, SeaGreen1Bis, SeaGreen2, SeaGreen3, SkyBlue1, SkyBlue2, SkyBlue3, SlateBlue1, SlateBlue3, SlateBlue3Bis, SpringGreen1, SpringGreen2, SpringGreen2Bis, SpringGreen3, SpringGreen3Bis, SpringGreen4, SteelBlue, SteelBlue1, SteelBlue1Bis, SteelBlue3, Tan, Thistle1, Thistle3, Turquoise2, Turquoise4, Violet, Wheat1, Wheat4, Yellow1, Yellow2, Yellow3, Yellow3Bis, Yellow4, Yellow4Bis };

Examples: component/homescreen, dom/color_gallery, dom/color_info_palette256

Public Member Functions ​

operator== ​

cpp
bool operator==(const Color & rhs) const;

operator!= ​

cpp
bool operator!=(const Color & rhs) const;

Print ​

cpp
std::string Print(bool is_background_color) const;

IsOpaque ​

cpp
bool IsOpaque() const;

Static Functions ​

Interpolate ​

cpp
static Color Interpolate(float t, const Color & a, const Color & b);

Blend ​

cpp
static Color Blend(const Color & lhs, const Color & rhs);

Blend two colors together using the alpha channel.