FastLED 3.9.15
|
#define DEFINE_GRADIENT_PALETTE | ( | X | ) |
Defines a static RGB palette very compactly using a series of connected color gradients.
For example, if you want the first 3/4ths of the palette to be a slow gradient ramping from black to red, and then the remaining 1/4 of the palette to be a quicker ramp to white, you specify just three points: the starting black point (at index 0), the red midpoint (at index 192), and the final white point (at index 255). It looks like this:
Here's how you'd define that gradient palette using this macro:
This format is designed for compact storage. The example palette here takes up just 12 bytes of PROGMEM (flash) storage, and zero bytes of SRAM when not currently in use.
To use one of these gradient palettes, simply assign it into a CRGBPalette16 or a CRGBPalette256, like this:
When the assignment is made, the gradients are expanded out into either 16 or 256 palette entries, depending on the kind of palette object they're assigned to.
DEFINE_GRADIENT_PALETTE
macro, this is taken of automatically.TProgmemRGBGradientPalette_byte must remain in the global namespace.
Definition at line 69 of file colorutils.h.