Description
@Hacker-3000's original PR #189 included each of the gradient palettes (by convention, variable names ending in _gp
) in the palette list. However, this appeared to convert each of the gradient palettes to CRGBPalette16
at startup, increasing both ROM and RAM usage.
To ensure this issue is tracked when that PR is merged (sans the gradient palettes), this issue was opened as it makes sense to support the gradient palettes as palette selections. Of course, the goal is to do so without keeping a second copy of each gradient palette in memory.
Given that the gradient palettes can be auto-converted to CRGBPalette16
on-the-fly, it seems more useful to simply expose both types of palettes to the web UI, and similarly accept a gradient palette as the current palette. There is not actually any need to convert the gradient palette to a CRGB
This could be done in a number of ways. The current strawman:
- When generating the JSON listing the available palettes, put first the existing
CRGBPalette16
palettes, and then follow with the..._gp
gradient palettes. In essence, pretend both the...16
and..._gp
palette arrays are concatenated. - When receiving a palette index selection via the REST API, interpret the index accordingly.
- When interpreting the palette index saved in EEPROM, interpret the index accordingly.