Color transformation to adjust the saturation and luminance of a RGB color value.
More...
#include <ColorSys.h>
|
static void | rgb2hsl (uint8_t red, uint8_t green, uint8_t blue, uint16_t &hue, float &saturation, float &luminance) |
| Translates an RGB (red, green, blue) color to an HSL (hue, saturation, luminance) color. More...
|
|
static void | hsl2rgb (uint16_t hue, float saturation, float luminance, uint8_t &red, uint8_t &green, uint8_t &blue) |
| Translates an HSL (hue, saturation, luminance) color to an RGB (red, green, blue) color. More...
|
|
static void | rgb2hsv (uint8_t red, uint8_t green, uint8_t blue, uint16_t &hue, uint8_t &saturation, uint8_t &value) |
| Translates an RGB (red, green, blue) color to an HSV (hue, saturation, value) color. More...
|
|
static void | hsv2rgb (uint16_t hue, uint8_t saturation, uint8_t value, uint8_t &red, uint8_t &green, uint8_t &blue) |
| Translates an HSV (hue, saturation, value) color to an RGB (red, green, blue) color. More...
|
|
Color transformation to adjust the saturation and luminance of a RGB color value.
§ hsl2rgb()
void ColorSys::hsl2rgb |
( |
uint16_t |
hue, |
|
|
float |
saturation, |
|
|
float |
luminance, |
|
|
uint8_t & |
red, |
|
|
uint8_t & |
green, |
|
|
uint8_t & |
blue |
|
) |
| |
|
static |
Translates an HSL (hue, saturation, luminance) color to an RGB (red, green, blue) color.
- Parameters
-
[in] | hue | The hue HSL-component |
[in] | saturation | The saturation HSL-component |
[in] | luminance | The luminance HSL-component |
[out] | red | The red RGB-component |
[out] | green | The green RGB-component |
[out] | blue | The blue RGB-component |
§ hsv2rgb()
void ColorSys::hsv2rgb |
( |
uint16_t |
hue, |
|
|
uint8_t |
saturation, |
|
|
uint8_t |
value, |
|
|
uint8_t & |
red, |
|
|
uint8_t & |
green, |
|
|
uint8_t & |
blue |
|
) |
| |
|
static |
Translates an HSV (hue, saturation, value) color to an RGB (red, green, blue) color.
- Parameters
-
[in] | hue | The hue HSV-component |
[in] | saturation | The saturation HSV-component |
[in] | value | The value HSV-component |
[out] | red | The red RGB-component |
[out] | green | The green RGB-component |
[out] | blue | The blue RGB-component |
- Note
- Integer version of the conversion are faster, but a little less accurate all values are unsigned 8 bit values and scaled between 0 and 255 except for the hue which is a 16 bit number and scaled between 0 and 360
§ rgb2hsl()
void ColorSys::rgb2hsl |
( |
uint8_t |
red, |
|
|
uint8_t |
green, |
|
|
uint8_t |
blue, |
|
|
uint16_t & |
hue, |
|
|
float & |
saturation, |
|
|
float & |
luminance |
|
) |
| |
|
static |
Translates an RGB (red, green, blue) color to an HSL (hue, saturation, luminance) color.
- Parameters
-
[in] | red | The red RGB-component |
[in] | green | The green RGB-component |
[in] | blue | The blue RGB-component |
[out] | hue | The hue HSL-component |
[out] | saturation | The saturation HSL-component |
[out] | luminance | The luminance HSL-component |
§ rgb2hsv()
void ColorSys::rgb2hsv |
( |
uint8_t |
red, |
|
|
uint8_t |
green, |
|
|
uint8_t |
blue, |
|
|
uint16_t & |
hue, |
|
|
uint8_t & |
saturation, |
|
|
uint8_t & |
value |
|
) |
| |
|
static |
Translates an RGB (red, green, blue) color to an HSV (hue, saturation, value) color.
- Parameters
-
[in] | red | The red RGB-component |
[in] | green | The green RGB-component |
[in] | blue | The blue RGB-component |
[out] | hue | The hue HSV-component |
[out] | saturation | The saturation HSV-component |
[out] | value | The value HSV-component |
- Note
- Integer version of the conversion are faster, but a little less accurate all values are unsigned 8 bit values and scaled between 0 and 255 except for the hue which is a 16 bit number and scaled between 0 and 360
The documentation for this class was generated from the following files:
- include/utils/ColorSys.h
- libsrc/utils/ColorSys.cpp