13 using rgba = std::array<uint8_t, 4>;
26 void set(uint8_t&& red = 0
29 , uint8_t&& alpha = 255);
36 , uint8_t&& alpha = 255
37 , uint8_t&& secondary_red = 0
38 , uint8_t&& secondary_green = 0
39 , uint8_t&& secondary_blue = 0
40 , uint8_t&& secondary_alpha = 255);
48 , uint8_t&& alpha = 255
49 , uint8_t&& secondary_red = 0
50 , uint8_t&& secondary_green = 0
51 , uint8_t&& secondary_blue = 0
52 , uint8_t&& secondary_alpha = 255);
55 rgba
get() const noexcept {
return value; };
70 bool operator== (
const color& other)
const;
Generic colour class holding RGBA values of a primary and a secondary colour. The blinking and pulsin...
Definition color.hpp:12
bool is_clear()
Checks if the primary colour, secondary colour and state are set to their initial values.
void set_blink(uint8_t &&red, uint8_t &&green, uint8_t &&blue, uint8_t &&alpha=255, uint8_t &&secondary_red=0, uint8_t &&secondary_green=0, uint8_t &&secondary_blue=0, uint8_t &&secondary_alpha=255)
Sets primary and secondary colour along with the blinking state.
void set(uint8_t &&red=0, uint8_t &&green=0, uint8_t &&blue=0, uint8_t &&alpha=255)
Sets the primary colour along with the constant state.
states get_state() const noexcept
Retrieves the current state.
Definition color.hpp:61
rgba get_secondary() const noexcept
Retrieves the secondary colour as rgba values.
Definition color.hpp:58
void set_pulse(uint8_t &&red, uint8_t &&green, uint8_t &&blue, uint8_t &&alpha=255, uint8_t &&secondary_red=0, uint8_t &&secondary_green=0, uint8_t &&secondary_blue=0, uint8_t &&secondary_alpha=255)
Sets primary and secondary colour along with the pulsing state.
void clear()
Resets primary colour, secondary colour and state to their initial values.
states
Definition color.hpp:16
@ blinking
Alternating between primary and secondary.
Definition color.hpp:18
@ constant
Primary colour only.
Definition color.hpp:17
@ pulsing
Smooth cycle between primary and secondary.
Definition color.hpp:19
rgba get() const noexcept
Retrieves the primary colour as rgba values.
Definition color.hpp:55