BuGUI
BUtton Grid User Interface
Loading...
Searching...
No Matches
bugui::color Struct Referencefinal

Generic colour class holding RGBA coloour values. The blinking and pulsing states indicate discrete or smooth cycling between the LED lit with the specified colour, and the LED turned off (set to black). More...

#include <color.hpp>

Public Types

enum  states : uint8_t { constant , blinking , pulsing }
using rgba = std::array<uint8_t, 4>

Public Member Functions

 color (uint8_t &&red, uint8_t &&green, uint8_t &&blue, uint8_t &&alpha=255)
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_blink (uint8_t &&red, uint8_t &&green, uint8_t &&blue, uint8_t &&alpha=255)
 Sets primary and secondary colour along with the blinking 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.
rgba get () const noexcept
 Retrieves the primary colour as rgba values.
states get_state () const noexcept
 Retrieves the current state.
void clear ()
 Resets primary colour, secondary colour and state to their initial values.
bool is_clear ()
 Checks if the primary colour, secondary colour and state are set to their initial values.
bool operator== (const color &other) const

Detailed Description

Generic colour class holding RGBA coloour values. The blinking and pulsing states indicate discrete or smooth cycling between the LED lit with the specified colour, and the LED turned off (set to black).

Member Enumeration Documentation

◆ states

enum bugui::color::states : uint8_t
Enumerator
constant 

Constant colour.

blinking 

Alternating between the colour and black.

pulsing 

Smooth cycle between the colour and black.


The documentation for this struct was generated from the following file: