hyperion.ng
Static Public Member Functions | List of all members
ColorSys Class Reference

Color transformation to adjust the saturation and luminance of a RGB color value. More...

#include <ColorSys.h>

Static Public Member Functions

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...
 

Detailed Description

Color transformation to adjust the saturation and luminance of a RGB color value.

Member Function Documentation

§ 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]hueThe hue HSL-component
[in]saturationThe saturation HSL-component
[in]luminanceThe luminance HSL-component
[out]redThe red RGB-component
[out]greenThe green RGB-component
[out]blueThe 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]hueThe hue HSV-component
[in]saturationThe saturation HSV-component
[in]valueThe value HSV-component
[out]redThe red RGB-component
[out]greenThe green RGB-component
[out]blueThe 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]redThe red RGB-component
[in]greenThe green RGB-component
[in]blueThe blue RGB-component
[out]hueThe hue HSL-component
[out]saturationThe saturation HSL-component
[out]luminanceThe 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]redThe red RGB-component
[in]greenThe green RGB-component
[in]blueThe blue RGB-component
[out]hueThe hue HSV-component
[out]saturationThe saturation HSV-component
[out]valueThe 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: