FastLED 3.9.3
|
Functions and class definitions for color palettes.
RGB palettes map an 8-bit value (0-255) to an RGB color.
You can create any color palette you wish; a couple of starters are provided: ForestColors_p, CloudColors_p, LavaColors_p, OceanColors_p, RainbowColors_p, and RainbowStripeColors_p.
Palettes come in the traditional 256-entry variety, which take up 768 bytes of RAM, and lightweight 16-entry varieties. The 16-entry variety automatically interpolates between its entries to produce a full 256-element color map, but at a cost of only 48 bytes of RAM.
Basic operation is like this (using the 16-entry variety):
Fill myPalette
with your own 16 colors, or with a preset color scheme. You can specify your 16 colors a variety of ways:
Or you can initiaize your palette with a preset color scheme:
Any time you want to set a pixel to a color from your palette, use ColorFromPalette()
as shown:
Even though your palette has only 16 explicily defined entries, you can use an "index" from 0-255. The 16 explicit palette entries will be spread evenly across the 0-255 range, and the intermedate values will be RGB-interpolated between adjacent explicit entries.
It's easier to use than it sounds.
Topics | |
Palette Classes | |
Class definitions for color palettes. | |
Palette Color Functions | |
Functions to retrieve smooth color data from palettes | |
Palette Upscaling Functions | |
Functions to upscale palettes from one type to another. | |
Predefined Color Palettes | |
Stock color palettes, only included when used. | |