58 constexpr explicit DeviceColor(
bool white =
true) : is_white(white) {}
62 [[nodiscard]]
constexpr auto to_byte() const noexcept -> std::uint8_t {
return is_white ? 0xFF : 0x00; }
102 constexpr explicit DeviceColor(std::uint8_t gray_level = 3) : level(gray_level & 0x03) {}
106 [[nodiscard]]
constexpr auto to_byte() const noexcept -> std::uint8_t {
109 return static_cast<std::uint8_t
>(level << 6);
112 [[nodiscard]]
constexpr auto to_rgb() const noexcept ->
RGB {
182 [[nodiscard]]
constexpr auto to_byte() const noexcept -> std::uint8_t {
return static_cast<std::uint8_t
>(color); }
187 [[nodiscard]]
constexpr auto to_rgb() const noexcept ->
RGB {
209 [[nodiscard]]
constexpr auto to_byte() const noexcept -> std::uint8_t {
return static_cast<std::uint8_t
>(color); }
214 [[nodiscard]]
constexpr auto to_rgb() const noexcept ->
RGB {
260 [[nodiscard]]
constexpr auto to_byte() const noexcept -> std::uint8_t {
return static_cast<std::uint8_t
>(color); }
262 [[nodiscard]]
constexpr auto to_uint8() const noexcept -> std::uint8_t {
return static_cast<std::uint8_t
>(color); }
264 [[nodiscard]]
constexpr auto to_rgb() const noexcept ->
RGB {
constexpr RGB Blue
Definition color.hpp:189
constexpr RGB Yellow
Definition color.hpp:190
constexpr RGB DarkGray
Definition color.hpp:194
constexpr RGB LightGray
Definition color.hpp:195
constexpr RGB Black
Definition color.hpp:185
constexpr RGB White
Definition color.hpp:186
constexpr RGB Red
Definition color.hpp:187
constexpr RGB Green
Definition color.hpp:188
TriColor
Color values for 3-color displays (Black/White/Red or Black/White/Yellow).
Definition device_color.hpp:144
@ Third
Red for BWR, Yellow for BWY.
DisplayMode
Definition driver.hpp:46
@ BWY
Black, White, Yellow (3 colors, typically 2-bit)
@ Spectra6
6-color: Black, White, Red, Yellow, Blue, Green (3-bit)
@ BlackWhite
1-bit black and white (2 colors)
@ Grayscale4
2-bit 4-level grayscale
@ BWR
Black, White, Red (3 colors, typically 2-bit)
Spectra6Color
Color values for Spectra 6 displays.
Definition device_color.hpp:248
constexpr auto to_rgb() const noexcept -> RGB
Definition device_color.hpp:187
TriColor color
Color value (Black, White, or Red)
Definition device_color.hpp:176
constexpr auto get_bw_bit() const noexcept -> bool
Definition device_color.hpp:184
constexpr auto to_byte() const noexcept -> std::uint8_t
Definition device_color.hpp:182
constexpr auto get_color_bit() const noexcept -> bool
Definition device_color.hpp:185
constexpr auto operator==(const DeviceColor &other) const noexcept -> bool=default
constexpr DeviceColor(TriColor c=TriColor::White)
Definition device_color.hpp:178
constexpr auto to_rgb() const noexcept -> RGB
Definition device_color.hpp:214
constexpr auto get_color_bit() const noexcept -> bool
Definition device_color.hpp:212
constexpr auto operator==(const DeviceColor &other) const noexcept -> bool=default
TriColor color
Color value (Black, White, or Yellow)
Definition device_color.hpp:203
constexpr auto get_bw_bit() const noexcept -> bool
Definition device_color.hpp:211
constexpr auto to_byte() const noexcept -> std::uint8_t
Definition device_color.hpp:209
constexpr DeviceColor(TriColor c=TriColor::White)
Definition device_color.hpp:205
constexpr auto operator==(const DeviceColor &other) const noexcept -> bool=default
constexpr auto to_byte() const noexcept -> std::uint8_t
Definition device_color.hpp:62
bool is_white
true = white, false = black
Definition device_color.hpp:56
constexpr DeviceColor(bool white=true)
Definition device_color.hpp:58
constexpr auto to_rgb() const noexcept -> RGB
Definition device_color.hpp:63
constexpr auto operator==(const DeviceColor &other) const noexcept -> bool=default
constexpr auto to_rgb() const noexcept -> RGB
Definition device_color.hpp:112
std::uint8_t level
Grayscale level (0-3, where 3 is white)
Definition device_color.hpp:100
constexpr auto to_byte() const noexcept -> std::uint8_t
Definition device_color.hpp:106
constexpr DeviceColor(std::uint8_t gray_level=3)
Definition device_color.hpp:102
constexpr auto to_rgb() const noexcept -> RGB
Definition device_color.hpp:264
constexpr auto to_byte() const noexcept -> std::uint8_t
Definition device_color.hpp:260
constexpr auto operator==(const DeviceColor &other) const noexcept -> bool=default
constexpr DeviceColor(Spectra6Color c=Spectra6Color::White)
Definition device_color.hpp:256
Spectra6Color color
Color value (one of 6 colors)
Definition device_color.hpp:254
constexpr auto to_uint8() const noexcept -> std::uint8_t
Definition device_color.hpp:262
Device-specific color representation (generic template).
Definition device_color.hpp:26
constexpr DeviceColor(std::uint8_t val=0)
Definition device_color.hpp:29
constexpr auto operator==(const DeviceColor &other) const noexcept -> bool=default
std::uint8_t value
Raw color value.
Definition device_color.hpp:27