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

◆ hsv2rgb_dispatch() [2/2]

FASTLED_FORCE_INLINE void hsv2rgb_dispatch ( const CHSV * phsv,
CRGB * prgb,
int numLeds )

HSV conversion function selection based on compile-time defines This allows users to configure which HSV conversion algorithm to use by setting one of the following defines:

  • FASTLED_HSV_CONVERSION_SPECTRUM: Use spectrum conversion
  • FASTLED_HSV_CONVERSION_FULL_SPECTRUM: Use full spectrum conversion
  • FASTLED_HSV_CONVERSION_RAINBOW: Use rainbow conversion (explicit)
  • Default (no define): Use rainbow conversion (backward compatibility) Array-based HSV conversion function selection using the same compile-time defines
    Parameters
    phsvCHSV array to convert to RGB
    prgbCRGB array to store the result of the conversion (will be modified)
    numLedsthe number of array values to process

Definition at line 47 of file crgb.h.

48{
49#if defined(FASTLED_HSV_CONVERSION_SPECTRUM)
50 hsv2rgb_spectrum(phsv, prgb, numLeds);
51#elif defined(FASTLED_HSV_CONVERSION_FULL_SPECTRUM)
52 hsv2rgb_fullspectrum(phsv, prgb, numLeds);
53#elif defined(FASTLED_HSV_CONVERSION_RAINBOW)
54 hsv2rgb_rainbow(phsv, prgb, numLeds);
55#else
56 // Default to rainbow for backward compatibility
57 hsv2rgb_rainbow(phsv, prgb, numLeds);
58#endif
59}
CRGB hsv2rgb_spectrum(const CHSV &hsv)
Inline version of hsv2rgb_spectrum which returns a CRGB object.
CRGB hsv2rgb_rainbow(const CHSV &hsv)
void hsv2rgb_fullspectrum(const CHSV &hsv, CRGB &rgb)
Converts an HSV value to RGB using the algorithm from here: https://en.wikipedia.org/wiki/HSL_and_HSV...

References FASTLED_FORCE_INLINE, hsv2rgb_fullspectrum(), hsv2rgb_rainbow(), and hsv2rgb_spectrum().

+ Here is the call graph for this function: