Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
99a163e
initial version, need to manually add iro.js
DedeHai Oct 8, 2025
4927151
serve iro.js as a seperate file, UX improvements in cpal.h
DedeHai Oct 8, 2025
0f9e740
full refactoring, added live preview, better minifying in cdata.js
DedeHai Oct 9, 2025
ec26c81
revert changes to cdata.js, change @import to link for css
DedeHai Oct 9, 2025
5cb7d9a
update main UI buttons, support for gaps in cpal files, cpal UI cleanup
DedeHai Oct 12, 2025
67d0b81
fixed some layout issues, added un-ordered cpal deletion
DedeHai Oct 12, 2025
47ec653
changed to tab indentation, paste button border color now holds store…
DedeHai Oct 12, 2025
3f481e7
fix preview to work properly and some other fixes in UI
DedeHai Oct 13, 2025
5bb6fdf
Merge branch 'main' into new_custom_palettes_editor
DedeHai Oct 13, 2025
19bbefa
always unfreeze
DedeHai Oct 13, 2025
0462cd0
new approach to loading iro.js, add harmonic random palette, many fixes.
DedeHai Oct 14, 2025
ab2e059
decoupling iro.j, update UI of cpal.htm, many fixes
DedeHai Oct 17, 2025
bd4267c
small change to buttons
DedeHai Oct 18, 2025
c140ed9
revert some changes
DedeHai Oct 18, 2025
c2a26bb
load iro.js dynamically, remove iro.js from index.htm, revert changes…
DedeHai Oct 18, 2025
10d242a
bugfix: dont call onload twice
DedeHai Oct 18, 2025
7f3fc74
Merge branch 'main' into new_custom_palettes_editor
DedeHai Oct 18, 2025
b99345a
bugfixes
DedeHai Oct 19, 2025
6953441
minor fixes suggested by the rabbit
DedeHai Oct 20, 2025
479eeeb
improved visibility for very dark/black palettes and markers
DedeHai Nov 24, 2025
44a0ccd
Merge branch 'main' into new_custom_palettes_editor
DedeHai Nov 25, 2025
531e840
Merge branch 'main' into new_custom_palettes_editor
DedeHai Jan 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ wled-update.sh
/wled00/Release
/wled00/wled00.ino.cpp
/wled00/html_*.h
/wled00/js_*.h
15 changes: 14 additions & 1 deletion tools/cdata.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const packageJson = require("../package.json");
// Export functions for testing
module.exports = { isFileNewerThan, isAnyFileInFolderNewerThan };

const output = ["wled00/html_ui.h", "wled00/html_pixart.h", "wled00/html_cpal.h", "wled00/html_edit.h", "wled00/html_pxmagic.h", "wled00/html_pixelforge.h", "wled00/html_settings.h", "wled00/html_other.h"]
const output = ["wled00/html_ui.h", "wled00/html_pixart.h", "wled00/html_cpal.h", "wled00/html_edit.h", "wled00/html_pxmagic.h", "wled00/html_pixelforge.h", "wled00/html_settings.h", "wled00/html_other.h", "wled00/js_iro.h"]

// \x1b[34m is blue, \x1b[36m is cyan, \x1b[0m is reset
const wledBanner = `
Expand Down Expand Up @@ -257,6 +257,19 @@ writeHtmlGzipped("wled00/data/pxmagic/pxmagic.htm", "wled00/html_pxmagic.h", 'px
writeHtmlGzipped("wled00/data/pixelforge/pixelforge.htm", "wled00/html_pixelforge.h", 'pixelforge', false); // do not inline css
//writeHtmlGzipped("wled00/data/edit.htm", "wled00/html_edit.h", 'edit');

writeChunks(
"wled00/data/",
[
{
file: "iro.js",
name: "JS_iro",
method: "gzip",
filter: "plain", // no minification, it is already minified
mangle: (s) => s.replace(/^\/\*![\s\S]*?\*\//, '') // remove license comment at the top
}
],
"wled00/js_iro.h"
);

writeChunks(
"wled00/data",
Expand Down
4 changes: 2 additions & 2 deletions usermods/audioreactive/audio_reactive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1742,14 +1742,14 @@ class AudioReactive : public Usermod {
}
#endif
}
if (root.containsKey(F("rmcpal")) && root[F("rmcpal")].as<bool>()) {
if (palettes > 0 && root.containsKey(F("rmcpal"))) {
// handle removal of custom palettes from JSON call so we don't break things
removeAudioPalettes();
}
}

void onStateChange(uint8_t callMode) override {
if (initDone && enabled && addPalettes && palettes==0 && customPalettes.size()<10) {
if (initDone && enabled && addPalettes && palettes==0 && customPalettes.size()<WLED_MAX_CUSTOM_PALETTES) {
// if palettes were removed during JSON call re-add them
createAudioPalettes();
}
Expand Down
8 changes: 5 additions & 3 deletions wled00/colors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,13 @@ void loadCustomPalettes() {
byte tcp[72]; //support gradient palettes with up to 18 entries
CRGBPalette16 targetPalette;
customPalettes.clear(); // start fresh
StaticJsonDocument<1536> pDoc; // barely enough to fit 72 numbers -> TODO: current format uses 214 bytes max per palette, why is this buffer so large?
unsigned emptyPaletteGap = 0; // count gaps in palette files to stop looking for more (each exists() call takes ~5ms)
for (int index = 0; index < WLED_MAX_CUSTOM_PALETTES; index++) {
char fileName[32];
sprintf_P(fileName, PSTR("/palette%d.json"), index);

StaticJsonDocument<1536> pDoc; // barely enough to fit 72 numbers
if (WLED_FS.exists(fileName)) {
emptyPaletteGap = 0; // reset gap counter if file exists
DEBUGFX_PRINTF_P(PSTR("Reading palette from %s\n"), fileName);
if (readObjectFromFile(fileName, nullptr, &pDoc)) {
JsonArray pal = pDoc[F("palette")];
Expand Down Expand Up @@ -288,7 +289,8 @@ void loadCustomPalettes() {
}
}
} else {
break;
emptyPaletteGap++;
if (emptyPaletteGap > WLED_MAX_CUSTOM_PALETTE_GAP) break; // stop looking for more palettes
}
}
}
Expand Down
1 change: 1 addition & 0 deletions wled00/const.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ constexpr size_t FIXED_PALETTE_COUNT = DYNAMIC_PALETTE_COUNT + FASTLED_PALETTE_C
#else
#define WLED_MAX_CUSTOM_PALETTES 10 // ESP8266: limit custom palettes to 10
#endif
#define WLED_MAX_CUSTOM_PALETTE_GAP 20 // max number of empty palette files in a row before stopping to look for more (20 takes 100ms)

// You can define custom product info from build flags.
// This is useful to allow API consumer to identify what type of WLED version
Expand Down
Loading