FastLED 3.9.15
Loading...
Searching...
No Matches

◆ hsv2rgb_spectrum() [2/3]

void hsv2rgb_spectrum ( const struct CHSV & hsv,
struct CRGB & rgb )

Convert an HSV value to RGB using a mathematically straight spectrum.

This "spectrum" will have more green and blue than a "rainbow", and less yellow and orange.

FastLED 'Spectrum' Hue Chart

Note
This function wraps hsv2rgb_raw() and rescales the hue value to fit the smaller range.
Parameters
hsvCHSV struct to convert to RGB. Max hue supported is HUE_MAX_SPECTRUM
rgbCRGB struct to store the result of the conversion (will be modified)

Definition at line 226 of file hsv2rgb.cpp.

227{
228 CHSV hsv2(hsv);
229 hsv2.hue = scale8( hsv2.hue, 191);
230 hsv2rgb_raw(hsv2, rgb);
231}
void hsv2rgb_raw(const struct CHSV &hsv, struct CRGB &rgb)
Convert an HSV value to RGB using a mathematically straight spectrum.
Definition hsv2rgb.cpp:23
LIB8STATIC_ALWAYS_INLINE uint8_t scale8(uint8_t i, fract8 scale)
Scale one byte by a second one, which is treated as the numerator of a fraction whose denominator is ...
Definition scale8.h:34
Representation of an HSV pixel (hue, saturation, value (aka brightness)).
Definition chsv.h:16

References hsv2rgb_raw(), and scale8().

Referenced by hsv2rgb_spectrum(), and hsv2rgb_spectrum().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: