kaycxx-term
C++ terminal library
Loading...
Searching...
No Matches
basic_color.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Klaus Reimer <k@ailis.de>
2// SPDX-License-Identifier: MIT
3
4#pragma once
5
11#include <cstdint>
12
13namespace kaycxx::term {
14
23 std::uint8_t index;
24
26 bool bright = false;
27};
28
30inline constexpr basic_color black{0};
31
33inline constexpr basic_color red{1};
34
36inline constexpr basic_color green{2};
37
39inline constexpr basic_color yellow{3};
40
42inline constexpr basic_color blue{4};
43
45inline constexpr basic_color magenta{5};
46
48inline constexpr basic_color cyan{6};
49
51inline constexpr basic_color white{7};
52
54inline constexpr basic_color bright_black{0, true};
55
57inline constexpr basic_color bright_red{1, true};
58
60inline constexpr basic_color bright_green{2, true};
61
63inline constexpr basic_color bright_yellow{3, true};
64
66inline constexpr basic_color bright_blue{4, true};
67
69inline constexpr basic_color bright_magenta{5, true};
70
72inline constexpr basic_color bright_cyan{6, true};
73
75inline constexpr basic_color bright_white{7, true};
76
77} // namespace kaycxx::term
constexpr basic_color bright_black
Bright ANSI color slot 0 (bright black, commonly rendered as dark gray).
Definition basic_color.hpp:54
constexpr basic_color bright_red
Bright ANSI color slot 1 (bright red).
Definition basic_color.hpp:57
constexpr basic_color cyan
ANSI color slot 6 (cyan).
Definition basic_color.hpp:48
constexpr basic_color white
ANSI color slot 7 (white, commonly rendered as light gray).
Definition basic_color.hpp:51
constexpr basic_color bright_blue
Bright ANSI color slot 4 (bright blue).
Definition basic_color.hpp:66
constexpr basic_color magenta
ANSI color slot 5 (magenta).
Definition basic_color.hpp:45
constexpr basic_color bright_cyan
Bright ANSI color slot 6 (bright cyan).
Definition basic_color.hpp:72
constexpr basic_color black
ANSI color slot 0 (black).
Definition basic_color.hpp:30
constexpr basic_color bright_magenta
Bright ANSI color slot 5 (bright magenta).
Definition basic_color.hpp:69
constexpr basic_color blue
ANSI color slot 4 (blue).
Definition basic_color.hpp:42
constexpr basic_color red
ANSI color slot 1 (red).
Definition basic_color.hpp:33
constexpr basic_color bright_yellow
Bright ANSI color slot 3 (bright yellow).
Definition basic_color.hpp:63
constexpr basic_color bright_green
Bright ANSI color slot 2 (bright green).
Definition basic_color.hpp:60
constexpr basic_color green
ANSI color slot 2 (green).
Definition basic_color.hpp:36
constexpr basic_color yellow
ANSI color slot 3 (yellow).
Definition basic_color.hpp:39
constexpr basic_color bright_white
Bright ANSI color slot 7 (bright white, commonly rendered as actual white).
Definition basic_color.hpp:75
Basic terminal palette color.
Definition basic_color.hpp:21
bool bright
Whether the bright variant of the color slot should be used.
Definition basic_color.hpp:26
std::uint8_t index
ANSI color slot from 0 to 7.
Definition basic_color.hpp:23