#ifndef __INC_HSV2RGB_H #define __INC_HSV2RGB_H #include "pixeltypes.h" // hsv2rgb_rainbow - convert a hue, saturation, and value to RGB // using a visually balanced rainbow (vs a straight // mathematical spectrum). // This 'rainbow' yields better yellow and orange // than a straight 'spectrum'. // // NOTE: here hue is 0-255, not just 0-191 void hsv2rgb_rainbow( const struct CHSV& hsv, struct CRGB& rgb); void hsv2rgb_rainbow( const struct CHSV* phsv, struct CRGB * prgb, int numLeds); #define HUE_MAX_RAINBOW 255 // hsv2rgb_spectrum - convert a hue, saturation, and value to RGB // using a mathematically straight spectrum (vs // a visually balanced rainbow). // This 'spectrum' will have more green & blue // than a 'rainbow', and less yellow and orange. // // NOTE: here hue is 0-255, not just 0-191 void hsv2rgb_spectrum( const struct CHSV& hsv, struct CRGB& rgb); void hsv2rgb_spectrum( const struct CHSV* phsv, struct CRGB * prgb, int numLeds); #define HUE_MAX_SPECTRUM 255 // hsv2rgb_raw - convert hue, saturation, and value to RGB. // This 'spectrum' conversion will be more green & blue // than a real 'rainbow', and the hue is specified just // in the range 0-191. Together, these result in a // slightly faster conversion speed, at the expense of // color balance. // // NOTE: Hue is 0-191 only! // Saturation & value are 0-255 each. // void hsv2rgb_raw(const struct CHSV& hsv, struct CRGB & rgb); void hsv2rgb_raw(const struct CHSV* phsv, struct CRGB * prgb, int numLeds); #define HUE_MAX 191 #endif