20 auto basic_color_display =
22 text(
"16 color palette:"),
67 auto palette_256_color_display =
text(
"256 colors palette:");
71 for (
auto& column : info_columns) {
73 for (
auto& it : column) {
74 column_elements.push_back(
77 columns.push_back(
hbox(std::move(column_elements)));
79 palette_256_color_display =
vbox({
80 palette_256_color_display,
87 auto true_color_display =
text(
"TrueColors: 24bits:");
89 const int max_value = 255;
90 const int value_increment = 8;
91 const int hue_increment = 6;
92 int saturation = max_value;
94 for (
int value = 0; value < max_value; value += 2 * value_increment) {
96 for (
int hue = 0; hue < max_value; hue += hue_increment) {
102 array.push_back(
hbox(std::move(line)));
104 true_color_display =
vbox({
107 vbox(std::move(array)),
114 ?
text(
" 16 color palette support : Yes")
115 :
text(
" 16 color palette support : No"),
117 ?
text(
"256 color palette support : Yes")
118 :
text(
"256 color palette support : No"),
120 ?
text(
" True color support : Yes")
121 :
text(
" True color support : No"),
128 palette_256_color_display,
A class representing terminal colors.
static Color HSV(uint8_t hue, uint8_t saturation, uint8_t value)
Build a Color from its HSV representation. https://en.wikipedia.org/wiki/HSL_and_HSV.
static Screen Create(Dimensions dimension)
Create a screen with the given dimension.
std::vector< std::vector< ftxui::ColorInfo > > ColorInfoSorted2D()
Dimensions Fit(Element &, bool extend_beyond_screen=false)
Color ColorSupport()
Get the color support of the terminal.
Decorator bgcolor(Color)
Decorate using a background color.
Element hbox(Elements)
A container displaying elements horizontally one by one.
std::vector< Element > Elements
Element text(std::wstring text)
Display a piece of unicode text.
Element separator()
Draw a vertical or horizontal separation in between two other elements.
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.
Element border(Element)
Draw a border around the element.
Decorator color(Color)
Decorate using a foreground color.
Element vbox(Elements)
A container displaying elements vertically one by one.