New custom palettes editor (#5010)

* full refactoring, added live preview, better minifying in cdata.js
* update main UI buttons, support for gaps in cpal files, cpal UI cleanup
* fixed some layout issues, added un-ordered cpal deletion
* changed to tab indentation, paste button border color now holds stored color
* fix preview to work properly and some other fixes in UI
* always unfreeze
* new approach to loading iro.js, add harmonic random palette, many fixes.
* decoupling iro.j, update UI of cpal.htm
- load iro.js sequentially
- no parallel requests in cpal.htm
- update UI buttons
- fix showing sequential loading of palettes (using opacity)
- better UX for mobile (larger markers, larger editor)
- various fixes
* small change to buttons
* load iro.js dynamically, remove iro.js from index.htm, revert changes to cdata.js
* improved visibility for very dark/black palettes and markers
This commit is contained in:
Damian Schneider
2026-01-30 20:35:15 +01:00
committed by GitHub
parent f19d29cd64
commit 2c4ed4249d
10 changed files with 962 additions and 674 deletions

View File

@@ -535,17 +535,15 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId)
else callMode = CALL_MODE_DIRECT_CHANGE; // possible bugfix for playlist only containing HTTP API preset FX=~
}
if (root.containsKey(F("rmcpal")) && root[F("rmcpal")].as<bool>()) {
if (customPalettes.size()) {
char fileName[32];
sprintf_P(fileName, PSTR("/palette%d.json"), customPalettes.size()-1);
if (WLED_FS.exists(fileName)) WLED_FS.remove(fileName);
loadCustomPalettes();
}
if (root.containsKey(F("rmcpal"))) {
char fileName[32];
sprintf_P(fileName, PSTR("/palette%d.json"), root[F("rmcpal")].as<uint8_t>());
if (WLED_FS.exists(fileName)) WLED_FS.remove(fileName);
loadCustomPalettes();
}
doAdvancePlaylist = root[F("np")] | doAdvancePlaylist; //advances to next preset in playlist when true
JsonObject wifi = root[F("wifi")];
if (!wifi.isNull()) {
bool apMode = getBoolVal(wifi[F("ap")], apActive);