FTXUI
6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
examples/dom/linear_gradient.cpp
Go to the documentation of this file.
1
// 版權所有 2023 Arthur Sonzogni. 保留所有權利。
2
// 本原始碼的使用受 MIT 授權條款約束,該條款可在 LICENSE 文件中找到。
3
// the LICENSE file.
4
#include <
ftxui/dom/elements.hpp
>
// 用於 bgcolor, operator|, operator|=, text, center, Element
5
#include <
ftxui/dom/linear_gradient.hpp
>
// 用於 LinearGradient::Stop, LinearGradient
6
#include <
ftxui/screen/screen.hpp
>
// 用於 Full, Screen
7
#include <memory>
// 用於 allocator, shared_ptr
8
9
#include "
ftxui/dom/node.hpp
"
// 用於 Render
10
#include "
ftxui/screen/color.hpp
"
// 用於 Color, Color::DeepPink1, Color::DeepSkyBlue1, Color::Yellow, ftxui
11
12
int
main
() {
13
using namespace
ftxui
;
14
auto
document = text(
"gradient"
) | center;
15
16
document |= bgcolor(
LinearGradient
()
17
.Angle(45)
18
.Stop(Color::DeepPink1)
19
.Stop(Color::DeepSkyBlue1));
20
auto
screen = Screen::Create(Dimension::Full(), Dimension::Full());
21
Render
(screen, document);
22
screen.Print();
23
24
return
0;
25
}
color.hpp
elements.hpp
main
int main()
Definition
examples/component/button.cpp:30
Render
void Render(Screen &screen, const Element &element)
在 ftxui::Screen 上顯示元素。
Definition
node.cpp:82
ftxui::LinearGradient
表示線性漸變顏色效果設定的類別。
Definition
linear_gradient.hpp:31
linear_gradient.hpp
ftxui
FTXUI 的 ftxui:: 命名空間
Definition
animation.hpp:10
node.hpp
screen.hpp