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 Format : uint8_t
15{
16 NONE = 0,
17 RESET,
18 BOLD,
19 DARK,
20 UNDERLINE,
21 BLINK,
22 REVERSE,
23 CONCEALED,
24 CLEAR_LINE,
25 COUNT
26};
27
31enum class Font : uint8_t
32{
33 NONE = 0,
34 BLACK,
35 RED,
36 GREEN,
37 YELLOW,
38 BLUE,
39 MAGENTA,
40 CYAN,
41 WHITE,
42 COUNT
43};
44
48enum class Background : uint8_t
49{
50 NONE = 0,
51 BLACK,
52 RED,
53 GREEN,
54 YELLOW,
55 BLUE,
56 MAGENTA,
57 CYAN,
58 WHITE,
59 COUNT
60};
61
67enum class Bold : uint8_t
68{
69 NONE = 0,
70 YELLOW,
71 RED,
72 ON_RED,
73 COUNT
74};
75
79inline constexpr const char* LIBXR_FORMAT_STR[] = {"", "\033[m", "\033[1m",
80 "\033[2m", "\033[4m", "\033[5m",
81 "\033[7m", "\033[8m", "\033[K"};
82
86inline constexpr const char* LIBXR_FONT_STR[] = {"", "\033[30m", "\033[31m",
87 "\033[32m", "\033[33m", "\033[34m",
88 "\033[35m", "\033[36m", "\033[37m"};
89
93inline constexpr const char* LIBXR_BACKGROUND_STR[] = {
94 "", "\033[40m", "\033[41m", "\033[42m", "\033[43m",
95 "\033[44m", "\033[45m", "\033[46m", "\033[47m"};
96
100inline constexpr const char* LIBXR_BOLD_STR[] = {"", "\033[33m\033[1m", "\033[31m\033[1m",
101 "\033[1m\033[41m"};
102
103} // namespace LibXR
104
105#endif // LIBXR_COLOR_HPP
LibXR 命名空间
Definition ch32_gpio.hpp:9
Background
Terminal background color (Background) / 终端背景颜色 (Background)
Font
Terminal font color (Font) / 终端字体颜色 (Font)
constexpr const char * LIBXR_BOLD_STR[]
ANSI escape sequences for bold styles / ANSI转义序列 - 粗体样式
Format
Terminal text format (Format) / 终端文本格式 (Format)
constexpr const char * LIBXR_FONT_STR[]
ANSI escape sequences for font color / ANSI转义序列 - 字体颜色
constexpr const char * LIBXR_FORMAT_STR[]
ANSI escape sequences for text format / ANSI转义序列 - 文本格式
Bold
Terminal bold style (Bold) / 终端粗体样式 (Bold)
constexpr const char * LIBXR_BACKGROUND_STR[]
ANSI escape sequences for background color / ANSI转义序列 - 背景颜色