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// Copyright 2023 Arthur Sonzogni. All rights reserved.
2// Use of this source code is governed by the MIT license that can be found in
3// the LICENSE file.
4#include <ftxui/dom/elements.hpp> // for bgcolor, operator|, operator|=, text, center, Element
5#include <ftxui/dom/linear_gradient.hpp> // for LinearGradient::Stop, LinearGradient
6#include <ftxui/screen/screen.hpp> // for Full, Screen
7#include <memory> // for allocator, shared_ptr
8
9#include "ftxui/dom/node.hpp" // for Render
10#include "ftxui/screen/color.hpp" // for 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/dom/linear_gradient.cpp:12
ftxui::LinearGradient
A class representing the settings for linear-gradient color effect.
Definition linear_gradient.hpp:32
linear_gradient.hpp
ftxui
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
node.hpp
screen.hpp