|
| Color () |
| Creates a new Color object. More...
|
|
| Color (uint8_t r_, uint8_t g_, uint8_t b_, uint8_t a_=255) |
| Creates a new Color object with the given channel values. More...
|
|
void | set (uint8_t r_, uint8_t g_, uint8_t b_, uint8_t a_=255) |
| Assigns a color from a set of RGBA values. More...
|
|
void | set_hsv (float h, float s, float v) |
| Assigns a color given in HSV colorspace. More...
|
|
void | get_hsv (float &h, float &s, float &v) const |
| Converts the current color to the HSV colorspace. More...
|
|
void | set_from_uint16 (uint16_t rgb) |
|
void | set_from_uint32 (uint32_t rgba) |
|
uint32_t | to_uint32 () const |
|
uint16_t | to_uint16 () const |
|
|
static Color const & | white () |
|
static Color const & | black () |
|
|
uint8_t | r |
| Red channel.
|
|
uint8_t | g |
| Green channel.
|
|
uint8_t | b |
| Blue channel.
|
|
uint8_t | a |
| Alpha channel.
|
|
Definition at line 38 of file lv_color.h.
Creates a new Color object.
All channels are set to 0.
Definition at line 48 of file lv_color.h.
LV::Color::Color |
( |
uint8_t |
r_, |
|
|
uint8_t |
g_, |
|
|
uint8_t |
b_, |
|
|
uint8_t |
a_ = 255 |
|
) |
| |
|
inline |
Creates a new Color object with the given channel values.
- Parameters
-
Definition at line 60 of file lv_color.h.
void LV::Color::get_hsv |
( |
float & |
h, |
|
|
float & |
s, |
|
|
float & |
v |
|
) |
| const |
Converts the current color to the HSV colorspace.
- Parameters
-
h | Variable to store the Hue value in (values will be in [0, 360] |
s | Variable to store the Saturation value in (values will be in [0, 1] |
v | Variable to store the Value value in (values will be in [0, 1] |
Definition at line 75 of file lv_color.cpp.
void LV::Color::set |
( |
uint8_t |
r_, |
|
|
uint8_t |
g_, |
|
|
uint8_t |
b_, |
|
|
uint8_t |
a_ = 255 |
|
) |
| |
|
inline |
Assigns a color from a set of RGBA values.
- Parameters
-
r | The red value. |
g | The green value. |
b | The blue value. |
a | The alpha value. |
Definition at line 87 of file lv_color.h.
void LV::Color::set_hsv |
( |
float |
h, |
|
|
float |
s, |
|
|
float |
v |
|
) |
| |
Assigns a color given in HSV colorspace.
- Parameters
-
h | Hue value in [0, 360] |
s | Saturation value in [0, 1] |
v | Value value in [0, 1] |
Definition at line 42 of file lv_color.cpp.
bool operator== |
( |
Color const & |
c1, |
|
|
Color const & |
c2 |
|
) |
| |
|
friend |
Equality operator for comparing two Color objects.
- Note
- RGB channels are compared.
- Parameters
-
- Returns
- true if colors are equal, false otherwise
Definition at line 74 of file lv_color.h.
The documentation for this struct was generated from the following files: