#include <memory>
#include <string>
Element ColorTile(
int red,
int green,
int blue) {
}
Element ColorString(
int red,
int green,
int blue) {
);
}
int main() {
int red = 128;
int green = 25;
int blue = 100;
auto slider_red =
Slider(
"Red :", &red, 0, 255, 1);
auto slider_green =
Slider(
"Green:", &green, 0, 255, 1);
auto slider_blue =
Slider(
"Blue :", &blue, 0, 255, 1);
slider_red,
slider_green,
slider_blue,
});
auto renderer =
Renderer(container, [&] {
ColorTile(red, green, blue),
slider_red->Render(),
slider_green->Render(),
slider_blue->Render(),
ColorString(red, green, blue),
}) |
});
screen.Loop(renderer);
}
static Color RGB(uint8_t red, uint8_t green, uint8_t blue)
Build a Color from its RGB representation. https://en.wikipedia.org/wiki/RGB_color_model.
static ScreenInteractive TerminalOutput()
Component Vertical(Components children)
A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
Decorator bgcolor(Color)
Decorate using a background color.
Element xflex(Element)
Expand/Minimize if possible/needed on the X axis.
Decorator size(WidthOrHeight, Constraint, int value)
Apply a constraint on the size of an element.
std::shared_ptr< Node > Element
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
Element hbox(Elements)
A container displaying elements horizontally one by one.
std::string to_string(const std::wstring &s)
Convert a UTF8 std::string into a std::wstring.
Element text(std::wstring text)
Display a piece of unicode text.
Component Slider(SliderOption< T > options)
A slider in any direction.
Element separator()
Draw a vertical or horizontal separation in between two other elements.
Element border(Element)
Draw a border around the element.
Element vbox(Elements)
A container displaying elements vertically one by one.