hyperion.ng
ColorSys.h
1 #pragma once
2 
3 // STL includes
4 #include <cstdint>
5 
9 class ColorSys
10 {
11 public:
22 
23  static void rgb2hsl(uint8_t red, uint8_t green, uint8_t blue, uint16_t & hue, float & saturation, float & luminance);
24 
35 
36  static void hsl2rgb(uint16_t hue, float saturation, float luminance, uint8_t & red, uint8_t & green, uint8_t & blue);
51  static void rgb2hsv(uint8_t red, uint8_t green, uint8_t blue, uint16_t & hue, uint8_t & saturation, uint8_t & value);
52 
67  static void hsv2rgb(uint16_t hue, uint8_t saturation, uint8_t value, uint8_t & red, uint8_t & green, uint8_t & blue);
68 };
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.
Definition: ColorSys.cpp:22
Color transformation to adjust the saturation and luminance of a RGB color value. ...
Definition: ColorSys.h:9
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...
Definition: ColorSys.cpp:14
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...
Definition: ColorSys.cpp:4
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.
Definition: ColorSys.cpp:30