FTXUI 7.0.3
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 是一個結構,包含有關終端機
16/// 顏色調色盤的資訊。
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 取得 palette256 的顏色資訊,以 2D 方式排序。
35/// @return 一個 2D 的 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:23
FTXUI ftxui:: 命名空間
Definition animation.hpp:11
int value
Definition elements.hpp:192