kaycxx-term
C++ terminal library
Loading...
Searching...
No Matches
rgb_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
18struct rgb_color {
20 std::uint8_t red;
21
23 std::uint8_t green;
24
26 std::uint8_t blue;
27};
28
37inline constexpr rgb_color rgb(
38 std::uint8_t red,
39 std::uint8_t green,
40 std::uint8_t blue
41) noexcept {
42 return {red, green, blue};
43}
44
45} // namespace kaycxx::term
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 green
ANSI color slot 2 (green).
Definition basic_color.hpp:36
constexpr rgb_color rgb(std::uint8_t red, std::uint8_t green, std::uint8_t blue) noexcept
Creates an RGB terminal color.
Definition rgb_color.hpp:37
RGB terminal color.
Definition rgb_color.hpp:18
std::uint8_t red
Red channel.
Definition rgb_color.hpp:20
std::uint8_t green
Green channel.
Definition rgb_color.hpp:23
std::uint8_t blue
Blue channel.
Definition rgb_color.hpp:26