FastLED 3.10.6
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
66
68
69//struct CRGB; // CRGB is now a typedef in crgb.h, not a struct
70using CRGB = fl::CRGB; // Bring the typedef into this namespace for consistency
71using CHSV = fl::hsv8; // Bring the typedef into this namespace for consistency
72
78void hsv2rgb_rainbow( const CHSV* phsv, CRGB * prgb, int numLeds);
79void hsv2rgb_rainbow( const CHSV& hsv, CRGB& rgb);
80CRGB hsv2rgb_rainbow( const CHSV& hsv);
81
83#define HUE_MAX_RAINBOW 255
84
85
97void hsv2rgb_spectrum( const CHSV& hsv, CRGB& rgb);
98
100CRGB hsv2rgb_spectrum( const CHSV& hsv);
101
107void hsv2rgb_spectrum( const CHSV* phsv, CRGB * prgb, int numLeds);
108
110#define HUE_MAX_SPECTRUM 255
111
112
113
121void hsv2rgb_raw(const CHSV& hsv, CRGB & rgb);
122
128void hsv2rgb_raw(const CHSV* phsv, CRGB * prgb, int numLeds);
129
131#define HUE_MAX 191
132
133
134
141void hsv2rgb_fullspectrum( const CHSV& hsv, CRGB& rgb);
142
144CRGB hsv2rgb_fullspectrum( const CHSV& hsv);
145
151void hsv2rgb_fullspectrum( const CHSV* phsv, CRGB * prgb, int numLeds);
152
153
154
190CHSV rgb2hsv_approximate( const CRGB& rgb);
191
192
193
194
196
197#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