![]() |
Doly C++ SDK v1.00
|
Simple 8-bit RGB color container and conversion helpers. More...
#include <Color.h>
Public Member Functions | |
| std::string | toString () |
| Convert this color to a human-readable string. | |
Static Public Member Functions | |
| static Color | getColor (uint8_t r, uint8_t g, uint8_t b) |
| Construct a Color from explicit RGB values. | |
| static Color | hexToRgb (std::string hex) |
| Convert a hex color string to RGB. | |
| static Color | getColor (ColorCode code) |
| Convert a predefined ColorCode to an RGB Color. | |
| static Color | getLEDColor (ColorCode code) |
| Convert a ColorCode to the closest LED-safe color tone. | |
| static std::string | getColorName (ColorCode code) |
| Get a human-readable name for a color code. | |
Public Attributes | |
| uint8_t | r = 0 |
| Red channel (0..255). | |
| uint8_t | g = 0 |
| Green channel (0..255). | |
| uint8_t | b = 0 |
| Blue channel (0..255). | |
Simple 8-bit RGB color container and conversion helpers.
Values are stored in 8-bit channels (0..255).
|
static |
|
static |
Get a human-readable name for a color code.
| code | Predefined color identifier. |
|
static |
Convert a hex color string to RGB.
Typical supported formats are implementation-defined, but commonly include:
| hex | Hex string. |
|
inline |
| uint8_t Color::b = 0 |
Blue channel (0..255).
| uint8_t Color::g = 0 |
Green channel (0..255).
| uint8_t Color::r = 0 |
Red channel (0..255).