FTXUI 6.1.9 C++ functional terminal UI.

Loading...
Searching...
No Matches
color_truecolor_HSV.cpp
Go to the documentation of this file.
1// Copyright 2020 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 operator|, Elements, Fit, bgcolor, color, hbox, text, vbox, Element
5#include <ftxui/screen/screen.hpp> // for Full, Screen
6#include <memory> // for allocator
7#include <utility> // for move
8
9#include "ftxui/dom/node.hpp" // for Render
10#include "ftxui/screen/color.hpp" // for Color, ftxui
11
12 int main() {
13 using namespace ftxui;
14
15 int saturation = 255;
16 Elements array;
17 for (int value = 0; value < 255; value += 20) {
18 Elements line;
19 for (int hue = 0; hue < 255; hue += 2) {
20 line.push_back(text("▀") //
21 | color(Color::HSV(hue, saturation, value)) //
22 | bgcolor(Color::HSV(hue, saturation, value + 10)));
23 }
24 array.push_back(hbox(std::move(line)));
25 }
26
27 auto document = vbox(std::move(array));
28
29 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
30 Render(screen, document);
31
32 screen.Print();
33
34 return 0;
35}
color.hpp
main
int main()
Definition color_truecolor_HSV.cpp:12
elements.hpp
ftxui
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
ftxui::Elements
std::vector< Element > Elements
Definition elements.hpp:23
node.hpp
screen.hpp