I’ve updated the ESP8266 FastLED Web Server example to include a palette selector. Here’s the simpler version in master: https://github.com/jasoncoon/esp8266-fastled-webserver/commit/681c29a8776a40026a26365d3988dedd38526417
And here’s the slightly more complicated version using the new dynamic field support in v1.1 (takes much less code): https://github.com/jasoncoon/esp8266-fastled-webserver/commit/f04a089fa4e42ddaf2508ea8b2df793f0ab8410e
Not all of the patterns use the selected palette yet, and there are currently two different palette lists: “simple” ones like rainbow, cloud, forest, etc, and the gradient palette list from Mark’s Palette Knife demos. I haven’t decided if/how I want to combine them.
I wasn’t able to figure out how to implement the palette list like the pattern list: as an array of structs with a palette and name. I tried several different approaches, but couldn’t get any of them to compile. I’ll admit I’m beyond my current C skill level. I ended up just using one array for the palettes, and another array for the names. It works, but it’s not ideal: as the palette list grows, it’ll be harder to keep the two arrays in sync.
Anyone have any ideas to get that to work? Compare the patterns list: https://github.com/jasoncoon/esp8266-fastled-webserver/blob/master/esp8266-fastled-webserver.ino#L274-L293 to the palettes list: https://github.com/jasoncoon/esp8266-fastled-webserver/blob/master/esp8266-fastled-webserver.ino#L297-L312