#include <memory>
auto document =
hbox({
text("normal") , text(" ") ,
text("bold") | bold , text(" ") ,
text("italic") | italic , text(" ") ,
text("dim") | dim , text(" ") ,
text("inverted") | inverted , text(" ") ,
text("underlined") | underlined , text(" ") ,
text("underlinedDouble") | underlinedDouble , text(" ") ,
text("blink") | blink , text(" ") ,
text("strikethrough") | strikethrough , text(" ") ,
text(
"color") |
color(Color::Blue) , text(
" ") ,
text(
"bgcolor") |
bgcolor(Color::Blue) , text(
" ") ,
text("hyperlink") | hyperlink("https://github.com/ArthurSonzogni/FTXUI"),
});
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
Render(screen, document);
screen.Print();
return 0;
}
Element color(const LinearGradient &gradient, Element child)
使用线性渐变效果设置元素的前景色。
Element bgcolor(const LinearGradient &gradient, Element child)
使用线性渐变效果设置元素的背景色。
#include "ftxui/component/component_base.hpp" // 用于 ComponentBase