79 return "r[" + std::to_string(
r) +
"] g[ " + std::to_string(
g) +
"] b[ " + std::to_string(
b) +
"]";
140 static std::vector<std::string> splitWithCharacters(
const std::string& str,
int splitLength);
ColorCode
Predefined color identifiers.
Definition Color.h:31
@ SKY_BLUE
Definition Color.h:48
@ BLACK
Definition Color.h:32
@ DARK_BLUE
Definition Color.h:50
@ BLUE
Definition Color.h:49
@ PINK
Definition Color.h:38
@ GOLD
Definition Color.h:40
@ LIME
Definition Color.h:44
@ CYAN
Definition Color.h:47
@ DARK_RED
Definition Color.h:37
@ GRAY
Definition Color.h:34
@ BROWN
Definition Color.h:51
@ ORANGE
Definition Color.h:39
@ YELLOW
Definition Color.h:41
@ GREEN
Definition Color.h:45
@ RED
Definition Color.h:36
@ WHITE
Definition Color.h:33
@ DARK_GREEN
Definition Color.h:46
@ MAGENTA
Definition Color.h:43
@ SALMON
Definition Color.h:35
@ PURPLE
Definition Color.h:42
Simple 8-bit RGB color container and conversion helpers.
Definition Color.h:60
uint8_t g
Green channel (0..255).
Definition Color.h:65
uint8_t b
Blue channel (0..255).
Definition Color.h:68
static Color getColor(uint8_t r, uint8_t g, uint8_t b)
Construct a Color from explicit RGB values.
std::string toString()
Convert this color to a human-readable string.
Definition Color.h:77
static Color getLEDColor(ColorCode code)
Convert a ColorCode to the closest LED-safe color tone.
uint8_t r
Red channel (0..255).
Definition Color.h:62
static Color hexToRgb(std::string hex)
Convert a hex color string to RGB.
static std::string getColorName(ColorCode code)
Get a human-readable name for a color code.
static Color getColor(ColorCode code)
Convert a predefined ColorCode to an RGB Color.