FTXUI 6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
color_info.hpp
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#ifndef FTXUI_SCREEN_COLOR_INFO_HPP
5#define FTXUI_SCREEN_COLOR_INFO_HPP
6
7#include <cstdint>
8#include <vector>
9
11#include <ftxui/util/export.hpp>
12
13namespace ftxui {
14
15/// @brief ColorInfo is a structure that contains information about the terminal
16/// color palette.
17///
18/// @ingroup screen
19struct FTXUI_EXPORT(SCREEN) ColorInfo {
20 const char* name;
21 uint8_t index_256;
22 uint8_t index_16;
23 uint8_t red;
24 uint8_t green;
25 uint8_t blue;
26 uint8_t hue;
27 uint8_t saturation;
28 uint8_t value;
29};
30
31FTXUI_EXPORT(SCREEN) ColorInfo GetColorInfo(Color::Palette256 index);
32FTXUI_EXPORT(SCREEN) ColorInfo GetColorInfo(Color::Palette16 index);
33
34/// @brief Get the color information for the palette256, sorted in 2D.
35/// @return A 2D vector of ColorInfo.
36/// @ingroup screen
37FTXUI_EXPORT(SCREEN) std::vector<std::vector<ColorInfo>> ColorInfoSorted2D();
38
39} // namespace ftxui
40
41#endif // FTXUI_SCREEN_COLOR_INFO_HPP
#define FTXUI_EXPORT(component)
Definition export.hpp:24
The FTXUI ftxui:: namespace.
Definition animation.hpp:11
int value
Definition elements.hpp:178