2#include <bugui/concepts/color.hpp>
15 using rgba = std::array<uint8_t, 4>;
28 , uint8_t&& alpha = 255);
32 void set(uint8_t&& red = 0
35 , uint8_t&& alpha = 255);
42 , uint8_t&& alpha = 255);
50 , uint8_t&& alpha = 255);
53 rgba
get() const noexcept {
return value; };
65 bool operator== (
const color& other)
const;
Generic colour class holding RGBA coloour values. The blinking and pulsing states indicate discrete o...
Definition color.hpp:14
bool is_clear()
Checks if the primary colour, secondary colour and state are set to their initial values.
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.
void set_pulse(uint8_t &&red, uint8_t &&green, uint8_t &&blue, uint8_t &&alpha=255)
Sets primary and secondary colour along with the pulsing state.
states get_state() const noexcept
Retrieves the current state.
Definition color.hpp:56
void clear()
Resets primary colour, secondary colour and state to their initial values.
states
Definition color.hpp:18
@ blinking
Alternating between the colour and black.
Definition color.hpp:20
@ constant
Constant colour.
Definition color.hpp:19
@ pulsing
Smooth cycle between the colour and black.
Definition color.hpp:21
void set_blink(uint8_t &&red, uint8_t &&green, uint8_t &&blue, uint8_t &&alpha=255)
Sets primary and secondary colour along with the blinking state.
rgba get() const noexcept
Retrieves the primary colour as rgba values.
Definition color.hpp:53