14#include <peak_icv_c/painting/peak_icv_painter.h>
56 Black = PEAK_ICV_COLOR_BLACK,
62 Red = PEAK_ICV_COLOR_RED,
68 Red8 = PEAK_ICV_COLOR_RED_8,
74 Red10 = PEAK_ICV_COLOR_RED_10,
80 Red12 = PEAK_ICV_COLOR_RED_12
105 constexpr explicit Color(uint64_t colorCodeRaw)
106 : m_colorCode{ colorCodeRaw }
118 constexpr Color(uint16_t red, uint16_t green, uint16_t blue)
119 :
Color(PEAK_ICV_COLOR_CODE(red, green, blue))
129 : m_colorCode{ static_cast<uint64_t>(colorCode) }
138 PEAK_ICV_NO_DISCARD
constexpr uint16_t
GetRed()
const
140 return static_cast<uint16_t
>(PEAK_ICV_COLOR_RED_FROM_CODE(m_colorCode));
149 PEAK_ICV_NO_DISCARD
constexpr uint16_t
GetGreen()
const
151 return static_cast<uint16_t
>(PEAK_ICV_COLOR_GREEN_FROM_CODE(m_colorCode));
160 PEAK_ICV_NO_DISCARD
constexpr uint16_t
GetBlue()
const
162 return static_cast<uint16_t
>(PEAK_ICV_COLOR_BLUE_FROM_CODE(m_colorCode));
172 PEAK_ICV_NO_DISCARD
constexpr std::tuple<red_t, green_t, blue_t>
GetRGB()
const
183 PEAK_ICV_NO_DISCARD
constexpr uint64_t
GetRaw()
const
195 return m_colorCode == rhs.m_colorCode;
205 return !(rhs == *
this);
215 return m_colorCode ==
static_cast<uint64_t
>(rhs);
225 return !(*
this == rhs);
229 uint64_t m_colorCode{};
Color class holding the actual color codes.
constexpr uint16_t GetGreen() const
Returns the green value for the color, that was specified.
constexpr uint16_t GetRed() const
Returns the red value for the color, that was specified.
constexpr Color(uint16_t red, uint16_t green, uint16_t blue)
Creates a Color from red, green and blue.
constexpr Color(ColorConstant colorCode)
Creates a Color a color constant.
constexpr uint64_t GetRaw() const
Returns the current colorCode in its raw format.
constexpr bool operator!=(const ColorConstant &rhs) const
constexpr std::tuple< red_t, green_t, blue_t > GetRGB() const
Returns the current colorCode as Red, Green, Blue The color as a tuple of red, green and blue values.
constexpr bool operator==(const ColorConstant &rhs) const
constexpr uint16_t GetBlue() const
Returns the blue value for the color, that was specified.
constexpr bool operator!=(const Color &rhs) const
constexpr bool operator==(const Color &rhs) const
constexpr Color()=default
Default Color is black.
constexpr Color(uint64_t colorCodeRaw)
The provided color code is one value containing rgb.
ColorConstant
ColorConstant.
uint16_t red_t
Typedef for Color red (value)
uint16_t green_t
Typedef for Color green (value)
uint16_t blue_t
Typedef for Color blue (value)