Class for handling simple colors
#include <color.h>
Public Types | |
| enum | PresetColor { RED , GREEN , BLUE , WHITE , PURPLE , CYAN , GOLD , OFF , LAST } |
Public Member Functions | |
| Color () | |
| Color (float r, float g, float b) | |
| ~Color () | |
| void | Init (PresetColor c) |
| void | Init (float red, float green, float blue) |
| float | Red () const |
| float | Green () const |
| float | Blue () const |
| uint8_t | Red8 () const |
| uint8_t | Green8 () const |
| uint8_t | Blue8 () const |
| void | SetRed (const float amt) |
| void | SetGreen (const float amt) |
| void | SetBlue (const float amt) |
| Color | operator* (float scale) |
| Color | operator+ (Color rhs) |
Static Public Member Functions | |
| static Color | Blend (const Color a, const Color b, const float amt) |
|
inline |
|
inline |
|
inline |
Returns a color that is blended between a and b
|
inline |
Returns the 0-1 value for Blue
|
inline |
|
inline |
Returns the 0-1 value for Green
|
inline |
| void daisy::Color::Init | ( | float | red, |
| float | green, | ||
| float | blue ) |
Initializes the Color with a specific RGB value red, green, and blue should be floats between 0 and 1
| red | Red value |
| green | Green value |
| blue | Blue value |
| void daisy::Color::Init | ( | PresetColor | c | ) |
|
inline |
Returns a scaled color by a float
Adds another color to this one, destructively saturating at 1
|
inline |
Returns the 0-1 value for Red
|
inline |
|
inline |
|
inline |
|
inline |