16class BgColor :
public NodeDecorator {
18 BgColor(
Element child, Color color)
19 : NodeDecorator(std::move(child)),
color_(color) {}
23 for (
int y = box_.y_min; y <= box_.y_max; ++y) {
24 for (
int x = box_.x_min; x <= box_.x_max; ++x) {
29 for (
int y = box_.y_min; y <= box_.y_max; ++y) {
30 for (
int x = box_.x_min; x <= box_.x_max; ++x) {
31 Color& color =
screen.PixelAt(x, y).background_color;
42class FgColor :
public NodeDecorator {
45 : NodeDecorator(std::move(child)),
color_(color) {}
49 for (
int y = box_.y_min; y <= box_.y_max; ++y) {
50 for (
int x = box_.x_min; x <= box_.x_max; ++x) {
55 for (
int y = box_.y_min; y <= box_.y_max; ++y) {
56 for (
int x = box_.x_min; x <= box_.x_max; ++x) {
57 Color& color =
screen.PixelAt(x, y).foreground_color;
82 return std::make_shared<FgColor>(std::move(child), color);
97 return std::make_shared<BgColor>(std::move(child), color);
111 return [c](
Element child) {
return color(c, std::move(child)); };
friend void Render(Screen &screen, Node *node, Selection &selection)
Decorator bgcolor(Color)
Decora usando un color de fondo.
void Render(Screen &screen, const Element &element)
Muestra un elemento en un ftxui::Screen.
Decorator color(Color)
Decora usando un color de primer plano.
static Color Blend(const Color &lhs, const Color &rhs)
Mezcla dos colores usando el canal alfa.
Color es una clase que representa un color en la interfaz de usuario de la terminal.
Color
Color es una enumeración que representa el soporte de color de la terminal.
El espacio de nombres ftxui:: de FTXUI.
std::function< Element(Element)> Decorator
std::shared_ptr< Node > Element