22 return text(
"RGB = (" +
23 std::to_string(red) +
"," +
24 std::to_string(green) +
"," +
25 std::to_string(blue) +
")"
33 auto slider_red =
Slider(
"Red :", &red, 0, 255, 1);
34 auto slider_green =
Slider(
"Green:", &green, 0, 255, 1);
35 auto slider_blue =
Slider(
"Blue :", &blue, 0, 255, 1);
37 auto container = Container::Vertical({
43 auto renderer =
Renderer(container, [&] {
50 slider_green->Render(),
52 slider_blue->Render(),
59 auto screen = App::TerminalOutput();
60 screen.Loop(renderer);
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
Element text(std::string_view text)
Display a piece of UTF8 encoded unicode text.
Decorator size(WidthOrHeight direction, Constraint constraint, int value)
Apply a constraint on the size of an element.
Element bgcolor(Color color, Element child)
Set the background color of an element.
Element separator()
Draw a vertical or horizontal separation in between two other elements.
Element vbox(Elements children)
A container displaying elements vertically one by one.
The FTXUI ftxui:: namespace.
std::shared_ptr< Node > Element
Element hbox(Elements children)
A container displaying elements horizontally one by one.
Component Slider(SliderOption< T > options)
A slider in any direction.
Element ColorTile(int red, int green, int blue)
Element ColorString(int red, int green, int blue)