FastLED 3.9.15
Loading...
Searching...
No Matches
hsv2rgb.h
Go to the documentation of this file.
1#pragma once
2
3#ifndef __INC_HSV2RGB_H
4#define __INC_HSV2RGB_H
5
6// Forward declarations
7#include "fl/gfx/crgb.h" // for fl::CRGB
8#include "fl/gfx/hsv.h" // for fl::hsv8
9
12
59
61
62//struct CRGB; // CRGB is now a typedef in crgb.h, not a struct
63using CRGB = fl::CRGB; // Bring the typedef into this namespace for consistency
64using CHSV = fl::hsv8; // Bring the typedef into this namespace for consistency
65
71void hsv2rgb_rainbow( const CHSV* phsv, CRGB * prgb, int numLeds);
72void hsv2rgb_rainbow( const CHSV& hsv, CRGB& rgb);
73CRGB hsv2rgb_rainbow( const CHSV& hsv);
74
76#define HUE_MAX_RAINBOW 255
77
78
90void hsv2rgb_spectrum( const CHSV& hsv, CRGB& rgb);
91
93CRGB hsv2rgb_spectrum( const CHSV& hsv);
94
100void hsv2rgb_spectrum( const CHSV* phsv, CRGB * prgb, int numLeds);
101
103#define HUE_MAX_SPECTRUM 255
104
105
106
114void hsv2rgb_raw(const CHSV& hsv, CRGB & rgb);
115
121void hsv2rgb_raw(const CHSV* phsv, CRGB * prgb, int numLeds);
122
124#define HUE_MAX 191
125
126
127
134void hsv2rgb_fullspectrum( const CHSV& hsv, CRGB& rgb);
135
137CRGB hsv2rgb_fullspectrum( const CHSV& hsv);
138
144void hsv2rgb_fullspectrum( const CHSV* phsv, CRGB * prgb, int numLeds);
145
146
147
183CHSV rgb2hsv_approximate( const CRGB& rgb);
184
185
186
187
189
190#endif
Defines the 8-bit red, green, and blue (RGB) pixel type in the fl namespace.
void hsv2rgb_rainbow(const CHSV *phsv, CRGB *prgb, int numLeds)
fl::hsv8 CHSV
Definition chsv.h:11
void hsv2rgb_spectrum(const CHSV &hsv, CRGB &rgb)
Convert an HSV value to RGB using a mathematically straight spectrum.
fl::CRGB CRGB
Definition crgb.h:25
CHSV rgb2hsv_approximate(const CRGB &rgb)
Recover approximate HSV values from RGB.
void hsv2rgb_raw(const CHSV &hsv, CRGB &rgb)
Convert an HSV value to RGB using a mathematically straight spectrum.
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...
Defines the hue, saturation, and value (HSV) pixel struct.
Representation of an 8-bit RGB pixel (Red, Green, Blue)
Definition crgb.h:38
Representation of an HSV pixel (hue, saturation, value (aka brightness)).
Definition hsv.h:16