#include <memory>
#include <utility>
int main() {
int saturation = 255;
for (int value = 0; value < 255; value += 3) {
int v = value * value / 255;
red_line.push_back(
text(
" ") |
bgcolor(Color::RGB(v, 0, 0)));
green_line.push_back(
text(
" ") |
bgcolor(Color::RGB(0, v, 0)));
blue_line.push_back(
text(
" ") |
bgcolor(Color::RGB(0, 0, v)));
cyan_line.push_back(
text(
" ") |
bgcolor(Color::RGB(0, v, v)));
magenta_line.push_back(
text(
" ") |
bgcolor(Color::RGB(v, 0, v)));
yellow_line.push_back(
text(
" ") |
bgcolor(Color::RGB(v, v, 0)));
}
})),
hbox({
text(
"magenta line:"),
hbox(std::move(magenta_line))}),
hbox({
text(
"Yellow line :"),
hbox(std::move(yellow_line))}),
})),
});
screen.Print();
return 0;
}
Dimensions Fit(Element &)
Decorator bgcolor(Color)
Decorate using a background color.
Element window(Element title, Element content)
Draw window with a title and a border around the element.
Element hbox(Elements)
A container displaying elements horizontally one by one.
Element text(std::wstring text)
Display a piece of unicode text.
std::vector< Element > Elements
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.
Element vbox(Elements)
A container displaying elements vertically one by one.