FastLED 3.9.3
Loading...
Searching...
No Matches
Color Fade Functions

Detailed Description

Functions for fading LED arrays

Functions

void fadeLightBy (CRGB *leds, uint16_t num_leds, uint8_t fadeBy)
 Reduce the brightness of an array of pixels all at once.
 
void fade_video (CRGB *leds, uint16_t num_leds, uint8_t fadeBy)
 Reduce the brightness of an array of pixels all at once.
 
void nscale8_video (CRGB *leds, uint16_t num_leds, uint8_t scale)
 Scale the brightness of an array of pixels all at once.
 
void fadeToBlackBy (CRGB *leds, uint16_t num_leds, uint8_t fadeBy)
 Reduce the brightness of an array of pixels all at once.
 
void fade_raw (CRGB *leds, uint16_t num_leds, uint8_t fadeBy)
 Reduce the brightness of an array of pixels all at once.
 
void nscale8 (CRGB *leds, uint16_t num_leds, uint8_t scale)
 Scale the brightness of an array of pixels all at once.
 
void fadeUsingColor (CRGB *leds, uint16_t numLeds, const CRGB &colormask)
 Reduce the brightness of an array of pixels as thought it were seen through a transparent filter with the specified color.
 

Function Documentation

◆ fade_raw()

void fade_raw ( CRGB * leds,
uint16_t num_leds,
uint8_t fadeBy )

Reduce the brightness of an array of pixels all at once.

This function will eventually fade all the way to black.

Parameters
ledsa pointer to the LED array to fade
num_ledsthe number of LEDs to fade
fadeByhow much to fade each LED

Definition at line 241 of file colorutils.cpp.

◆ fade_video()

void fade_video ( CRGB * leds,
uint16_t num_leds,
uint8_t fadeBy )

Reduce the brightness of an array of pixels all at once.

Guaranteed to never fade all the way to black.

Parameters
ledsa pointer to the LED array to fade
num_ledsthe number of LEDs to fade
fadeByhow much to fade each LED

Definition at line 225 of file colorutils.cpp.

◆ fadeLightBy()

void fadeLightBy ( CRGB * leds,
uint16_t num_leds,
uint8_t fadeBy )

Reduce the brightness of an array of pixels all at once.

Guaranteed to never fade all the way to black.

Parameters
ledsa pointer to the LED array to fade
num_ledsthe number of LEDs to fade
fadeByhow much to fade each LED

Definition at line 230 of file colorutils.cpp.

◆ fadeToBlackBy()

void fadeToBlackBy ( CRGB * leds,
uint16_t num_leds,
uint8_t fadeBy )

Reduce the brightness of an array of pixels all at once.

This function will eventually fade all the way to black.

Parameters
ledsa pointer to the LED array to fade
num_ledsthe number of LEDs to fade
fadeByhow much to fade each LED

Definition at line 236 of file colorutils.cpp.

◆ fadeUsingColor()

void fadeUsingColor ( CRGB * leds,
uint16_t numLeds,
const CRGB & colormask )

Reduce the brightness of an array of pixels as thought it were seen through a transparent filter with the specified color.

For example, if the colormask if CRGB(200, 100, 50), then the pixels' red will be faded to 200/256ths, their green to 100/256ths, and their blue to 50/256ths. This particular example will give a "hot fade" look, with white fading to yellow, then red, then black. You can also use colormasks like CRGB::Blue to zero out the red and green elements, leaving blue (largely) the same.

Parameters
ledsa pointer to the LED array to fade
numLedsthe number of LEDs to fade
colormaskthe color mask to fade with

Definition at line 260 of file colorutils.cpp.

◆ nscale8()

void nscale8 ( CRGB * leds,
uint16_t num_leds,
uint8_t scale )

Scale the brightness of an array of pixels all at once.

This function will eventually fade all the way to black, even if "scale" is not zero.

Parameters
ledsa pointer to the LED array to scale
num_ledsthe number of LEDs to scale
scalehow much to scale each LED

Definition at line 253 of file colorutils.cpp.

◆ nscale8_video()

void nscale8_video ( CRGB * leds,
uint16_t num_leds,
uint8_t scale )

Scale the brightness of an array of pixels all at once.

Guaranteed to never fade all the way to black.

Parameters
ledsa pointer to the LED array to scale
num_ledsthe number of LEDs to scale
scalehow much to scale each LED

Definition at line 218 of file colorutils.cpp.