FastLED 3.9.12
|
Functions for filling LED arrays with colors and gradients
Macros | |
#define | saccum87 int16_t |
ANSI: signed short _Accum. | |
#define | fill_gradient_HSV fill_gradient |
Convenience synonym. | |
Enumerations | |
enum | TGradientDirectionCode { FORWARD_HUES , BACKWARD_HUES , SHORTEST_HUES , LONGEST_HUES } |
Hue direction for calculating fill gradients. More... | |
Functions | |
void | fill_solid (struct CRGB *targetArray, int numToFill, const struct CRGB &color) |
Fill a range of LEDs with a solid color. | |
void | fill_solid (struct CHSV *targetArray, int numToFill, const struct CHSV &color) |
Fill a range of LEDs with a solid color. | |
void | fill_rainbow (struct CRGB *targetArray, int numToFill, uint8_t initialhue, uint8_t deltahue=5) |
Fill a range of LEDs with a rainbow of colors. | |
void | fill_rainbow (struct CHSV *targetArray, int numToFill, uint8_t initialhue, uint8_t deltahue=5) |
Fill a range of LEDs with a rainbow of colors. | |
void | fill_rainbow_circular (struct CRGB *targetArray, int numToFill, uint8_t initialhue, bool reversed=false) |
Fill a range of LEDs with a rainbow of colors, so that the hues are continuous between the end of the strip and the beginning. | |
void | fill_rainbow_circular (struct CHSV *targetArray, int numToFill, uint8_t initialhue, bool reversed=false) |
Fill a range of LEDs with a rainbow of colors, so that the hues are continuous between the end of the strip and the beginning. | |
template<typename T > | |
void | fill_gradient (T *targetArray, uint16_t startpos, CHSV startcolor, uint16_t endpos, CHSV endcolor, TGradientDirectionCode directionCode=SHORTEST_HUES) |
Fill a range of LEDs with a smooth HSV gradient between two HSV colors. | |
template<typename T > | |
void | fill_gradient (T *targetArray, uint16_t numLeds, const CHSV &c1, const CHSV &c2, TGradientDirectionCode directionCode=SHORTEST_HUES) |
Fill a range of LEDs with a smooth HSV gradient between two HSV colors. | |
template<typename T > | |
void | fill_gradient (T *targetArray, uint16_t numLeds, const CHSV &c1, const CHSV &c2, const CHSV &c3, TGradientDirectionCode directionCode=SHORTEST_HUES) |
Fill a range of LEDs with a smooth HSV gradient between three HSV colors. | |
template<typename T > | |
void | fill_gradient (T *targetArray, uint16_t numLeds, const CHSV &c1, const CHSV &c2, const CHSV &c3, const CHSV &c4, TGradientDirectionCode directionCode=SHORTEST_HUES) |
Fill a range of LEDs with a smooth HSV gradient between four HSV colors. | |
void | fill_gradient_RGB (CRGB *leds, uint16_t startpos, CRGB startcolor, uint16_t endpos, CRGB endcolor) |
Fill a range of LEDs with a smooth RGB gradient between two RGB colors. | |
void | fill_gradient_RGB (CRGB *leds, uint16_t numLeds, const CRGB &c1, const CRGB &c2) |
Fill a range of LEDs with a smooth RGB gradient between two RGB colors. | |
void | fill_gradient_RGB (CRGB *leds, uint16_t numLeds, const CRGB &c1, const CRGB &c2, const CRGB &c3) |
Fill a range of LEDs with a smooth RGB gradient between three RGB colors. | |
void | fill_gradient_RGB (CRGB *leds, uint16_t numLeds, const CRGB &c1, const CRGB &c2, const CRGB &c3, const CRGB &c4) |
Fill a range of LEDs with a smooth RGB gradient between four RGB colors. | |
CRGB | HeatColor (uint8_t temperature) |
Approximates a "black body radiation" spectrum for a given "heat" level. | |
#define fill_gradient_HSV fill_gradient |
Convenience synonym.
Definition at line 353 of file colorutils.h.
#define saccum87 int16_t |
ANSI: signed short _Accum.
8 bits int, 7 bits fraction
Definition at line 170 of file colorutils.h.
Hue direction for calculating fill gradients.
Since "hue" is a value around a color wheel, there are always two directions to sweep from one hue to another.
Definition at line 160 of file colorutils.h.
void fill_gradient | ( | T * | targetArray, |
uint16_t | numLeds, | ||
const CHSV & | c1, | ||
const CHSV & | c2, | ||
const CHSV & | c3, | ||
const CHSV & | c4, | ||
TGradientDirectionCode | directionCode = SHORTEST_HUES ) |
Fill a range of LEDs with a smooth HSV gradient between four HSV colors.
targetArray | a pointer to the color array to fill |
numLeds | the number of LEDs to fill |
c1 | the starting color in the gradient |
c2 | the first middle color for the gradient |
c3 | the second middle color for the gradient |
c4 | the end color for the gradient |
directionCode | the direction to travel around the color wheel |
Definition at line 340 of file colorutils.h.
void fill_gradient | ( | T * | targetArray, |
uint16_t | numLeds, | ||
const CHSV & | c1, | ||
const CHSV & | c2, | ||
const CHSV & | c3, | ||
TGradientDirectionCode | directionCode = SHORTEST_HUES ) |
Fill a range of LEDs with a smooth HSV gradient between three HSV colors.
targetArray | a pointer to the color array to fill |
numLeds | the number of LEDs to fill |
c1 | the starting color in the gradient |
c2 | the middle color for the gradient |
c3 | the end color for the gradient |
directionCode | the direction to travel around the color wheel |
Definition at line 320 of file colorutils.h.
void fill_gradient | ( | T * | targetArray, |
uint16_t | numLeds, | ||
const CHSV & | c1, | ||
const CHSV & | c2, | ||
TGradientDirectionCode | directionCode = SHORTEST_HUES ) |
Fill a range of LEDs with a smooth HSV gradient between two HSV colors.
targetArray | a pointer to the color array to fill |
numLeds | the number of LEDs to fill |
c1 | the starting color in the gradient |
c2 | the end color for the gradient |
directionCode | the direction to travel around the color wheel |
Definition at line 304 of file colorutils.h.
void fill_gradient | ( | T * | targetArray, |
uint16_t | startpos, | ||
CHSV | startcolor, | ||
uint16_t | endpos, | ||
CHSV | endcolor, | ||
TGradientDirectionCode | directionCode = SHORTEST_HUES ) |
Fill a range of LEDs with a smooth HSV gradient between two HSV colors.
This function can write the gradient colors either:
In the case of writing into a CRGB array, the gradient is computed in HSV space, and then HSV values are converted to RGB as they're written into the CRGB array.
targetArray | a pointer to the color array to fill |
startpos | the starting position in the array |
startcolor | the starting color for the gradient |
endpos | the ending position in the array |
endcolor | the end color for the gradient |
directionCode | the direction to travel around the color wheel |
Definition at line 189 of file colorutils.h.
Fill a range of LEDs with a smooth RGB gradient between two RGB colors.
leds | a pointer to the LED array to fill |
numLeds | the number of LEDs to fill |
c1 | the starting color in the gradient |
c2 | the end color for the gradient |
Definition at line 224 of file colorutils.cpp.
void fill_gradient_RGB | ( | CRGB * | leds, |
uint16_t | numLeds, | ||
const CRGB & | c1, | ||
const CRGB & | c2, | ||
const CRGB & | c3 ) |
Fill a range of LEDs with a smooth RGB gradient between three RGB colors.
leds | a pointer to the LED array to fill |
numLeds | the number of LEDs to fill |
c1 | the starting color in the gradient |
c2 | the middle color for the gradient |
c3 | the end color for the gradient |
Definition at line 231 of file colorutils.cpp.
void fill_gradient_RGB | ( | CRGB * | leds, |
uint16_t | numLeds, | ||
const CRGB & | c1, | ||
const CRGB & | c2, | ||
const CRGB & | c3, | ||
const CRGB & | c4 ) |
Fill a range of LEDs with a smooth RGB gradient between four RGB colors.
leds | a pointer to the LED array to fill |
numLeds | the number of LEDs to fill |
c1 | the starting color in the gradient |
c2 | the first middle color for the gradient |
c3 | the second middle color for the gradient |
c4 | the end color for the gradient |
Definition at line 239 of file colorutils.cpp.
void fill_gradient_RGB | ( | CRGB * | leds, |
uint16_t | startpos, | ||
CRGB | startcolor, | ||
uint16_t | endpos, | ||
CRGB | endcolor ) |
Fill a range of LEDs with a smooth RGB gradient between two RGB colors.
Unlike HSV, there is no "color wheel" in RGB space, and therefore there's only one "direction" for the gradient to go. This means there's no TGradientDirectionCode parameter for direction.
leds | a pointer to the LED array to fill |
startpos | the starting position in the array |
startcolor | the starting color for the gradient |
endpos | the ending position in the array |
endcolor | the end color for the gradient |
Definition at line 145 of file colorutils.cpp.
void fill_rainbow | ( | struct CHSV * | targetArray, |
int | numToFill, | ||
uint8_t | initialhue, | ||
uint8_t | deltahue = 5 ) |
Fill a range of LEDs with a rainbow of colors.
The colors making up the rainbow are at full saturation and full value (brightness).
targetArray | a pointer to the LED array to fill |
numToFill | the number of LEDs to fill in the array |
initialhue | the starting hue for the rainbow |
deltahue | how many hue values to advance for each LED |
Definition at line 89 of file colorutils.cpp.
void fill_rainbow | ( | struct CRGB * | targetArray, |
int | numToFill, | ||
uint8_t | initialhue, | ||
uint8_t | deltahue = 5 ) |
Fill a range of LEDs with a rainbow of colors.
The colors making up the rainbow are at full saturation and full value (brightness).
targetArray | a pointer to the LED array to fill |
numToFill | the number of LEDs to fill in the array |
initialhue | the starting hue for the rainbow |
deltahue | how many hue values to advance for each LED |
Definition at line 75 of file colorutils.cpp.
void fill_rainbow_circular | ( | struct CHSV * | targetArray, |
int | numToFill, | ||
uint8_t | initialhue, | ||
bool | reversed = false ) |
Fill a range of LEDs with a rainbow of colors, so that the hues are continuous between the end of the strip and the beginning.
The colors making up the rainbow are at full saturation and full value (brightness).
targetArray | a pointer to the LED array to fill |
numToFill | the number of LEDs to fill in the array |
initialhue | the starting hue for the rainbow |
reversed | whether to progress through the rainbow hues backwards |
Definition at line 124 of file colorutils.cpp.
void fill_rainbow_circular | ( | struct CRGB * | targetArray, |
int | numToFill, | ||
uint8_t | initialhue, | ||
bool | reversed = false ) |
Fill a range of LEDs with a rainbow of colors, so that the hues are continuous between the end of the strip and the beginning.
The colors making up the rainbow are at full saturation and full value (brightness).
targetArray | a pointer to the LED array to fill |
numToFill | the number of LEDs to fill in the array |
initialhue | the starting hue for the rainbow |
reversed | whether to progress through the rainbow hues backwards |
Definition at line 104 of file colorutils.cpp.
Fill a range of LEDs with a solid color.
targetArray | a pointer to the LED array to fill |
numToFill | the number of LEDs to fill in the array |
color | the color to fill with |
Definition at line 60 of file colorutils.cpp.
Fill a range of LEDs with a solid color.
targetArray | a pointer to the LED array to fill |
numToFill | the number of LEDs to fill in the array |
color | the color to fill with |
Definition at line 52 of file colorutils.cpp.
CRGB HeatColor | ( | uint8_t | temperature | ) |
Approximates a "black body radiation" spectrum for a given "heat" level.
This is useful for animations of "fire". Heat is specified as an arbitrary scale from 0 (cool) to 255 (hot). This is NOT a chromatically correct "black body radiation" spectrum, but it's surprisingly close, and it's fast and small.
Definition at line 543 of file colorutils.cpp.