16class BgColor :
public NodeDecorator {
22 for (
int y = box_.y_min; y <= box_.y_max; ++y) {
23 for (
int x = box_.x_min; x <= box_.x_max; ++x) {
24 screen.PixelAt(x, y).background_color = color_;
33class FgColor :
public NodeDecorator {
39 for (
int y = box_.y_min; y <= box_.y_max; ++y) {
40 for (
int x = box_.x_min; x <= box_.x_max; ++x) {
41 screen.PixelAt(x, y).foreground_color = color_;
63 return std::make_shared<FgColor>(std::move(
child),
color);
78 return std::make_shared<BgColor>(std::move(
child),
color);
A class representing terminal colors.
virtual void Render(Screen &screen)
Display an element on a ftxui::Screen.
Decorator bgcolor(Color)
Decorate using a background color.
std::function< Element(Element)> Decorator
std::shared_ptr< Node > Element
Component Slider(SliderOption< T > options)
A slider in any direction.
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.
Decorator color(Color)
Decorate using a foreground color.