libxr  1.0
Want to be the best embedded framework
Loading...
Searching...
No Matches
libxr_color.hpp
1#ifndef LIBXR_COLOR_HPP
2#define LIBXR_COLOR_HPP
3
4#include <cstdint>
5
6namespace LibXR
7{
8
14enum class TextStyle : uint8_t
15{
16 NONE = 0,
17 BOLD,
18 DIM,
19 UNDERLINE,
20 BLINK,
21 REVERSE,
22 CONCEALED,
23 COUNT
24};
25
31enum class TerminalControl : uint8_t
32{
33 NONE = 0,
34 RESET,
35 ERASE_LINE,
36 COUNT
37};
38
42enum class Foreground : uint8_t
43{
44 NONE = 0,
45 BLACK,
46 RED,
47 GREEN,
48 YELLOW,
49 BLUE,
50 MAGENTA,
51 CYAN,
52 WHITE,
53 COUNT
54};
55
59enum class Background : uint8_t
60{
61 NONE = 0,
62 BLACK,
63 RED,
64 GREEN,
65 YELLOW,
66 BLUE,
67 MAGENTA,
68 CYAN,
69 WHITE,
70 COUNT
71};
72
78enum class Preset : uint8_t
79{
80 NONE = 0,
81 YELLOW_BOLD,
82 RED_BOLD,
83 BOLD_ON_RED,
84 COUNT
85};
86
90inline constexpr const char* LIBXR_TEXT_STYLE_STR[] = {"", "\033[1m", "\033[2m",
91 "\033[4m", "\033[5m", "\033[7m",
92 "\033[8m"};
93
97inline constexpr const char* LIBXR_TERMINAL_CONTROL_STR[] = {"", "\033[m", "\033[K"};
98
102inline constexpr const char* LIBXR_FOREGROUND_STR[] = {
103 "", "\033[30m", "\033[31m", "\033[32m", "\033[33m",
104 "\033[34m", "\033[35m", "\033[36m", "\033[37m"};
105
109inline constexpr const char* LIBXR_BACKGROUND_STR[] = {
110 "", "\033[40m", "\033[41m", "\033[42m", "\033[43m",
111 "\033[44m", "\033[45m", "\033[46m", "\033[47m"};
112
116inline constexpr const char* LIBXR_PRESET_STR[] = {
117 "", "\033[33m\033[1m", "\033[31m\033[1m", "\033[1m\033[41m"};
118
119} // namespace LibXR
120
121#endif // LIBXR_COLOR_HPP
LibXR 命名空间
Definition ch32_can.hpp:14
Background
Terminal background color / 终端背景色
constexpr const char * LIBXR_PRESET_STR[]
ANSI escape sequences for text presets / ANSI转义序列 - 文本预设
TextStyle
Terminal text style / 终端文本样式
constexpr const char * LIBXR_TERMINAL_CONTROL_STR[]
ANSI escape sequences for terminal controls / ANSI转义序列 - 终端控制
constexpr const char * LIBXR_FOREGROUND_STR[]
ANSI escape sequences for foreground colors / ANSI转义序列 - 前景色
Foreground
Terminal foreground color / 终端前景色
constexpr const char * LIBXR_BACKGROUND_STR[]
ANSI escape sequences for background color / ANSI转义序列 - 背景颜色
constexpr const char * LIBXR_TEXT_STYLE_STR[]
ANSI escape sequences for text styles / ANSI转义序列 - 文本样式
TerminalControl
Terminal control sequence / 终端控制序列
Preset
Terminal text preset / 终端文本预设