From d9a7879c454f744fb8351caa021ff6e1871592ca Mon Sep 17 00:00:00 2001 From: Vito Sansevero Date: Wed, 27 Aug 2025 09:29:14 -0700 Subject: [PATCH] fix: ensure valid color format in custom colors --- web/kiko_custom_colors.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/web/kiko_custom_colors.js b/web/kiko_custom_colors.js index e295bc1..8e19af2 100644 --- a/web/kiko_custom_colors.js +++ b/web/kiko_custom_colors.js @@ -93,7 +93,7 @@ app.registerExtension({ : Object.values(graphcanvas.selected_nodes); nodes.forEach(n => { - if (colorValue) { + if (colorValue && colorValue !== "" && colorValue.startsWith("#")) { if (n.constructor === LiteGraph.LGraphGroup) { // For groups, only set the main color if (colorType === 'full' || colorType === 'bg') { @@ -167,9 +167,8 @@ app.registerExtension({ if (!pickerFull) { pickerFull = createPicker('full'); } - activeNode = null; - pickerFull.value = node.bgcolor || "#000000"; activeNode = node; + pickerFull.value = node.bgcolor || "#000000"; pickerFull.click(); }; }, @@ -198,9 +197,8 @@ app.registerExtension({ if (!pickerTitle) { pickerTitle = createPicker('title'); } - activeNode = null; - pickerTitle.value = node.color || "#000000"; activeNode = node; + pickerTitle.value = node.color || "#000000"; pickerTitle.click(); }; }, @@ -229,9 +227,8 @@ app.registerExtension({ if (!pickerBG) { pickerBG = createPicker('bg'); } - activeNode = null; - pickerBG.value = node.bgcolor || "#000000"; activeNode = node; + pickerBG.value = node.bgcolor || "#000000"; pickerBG.click(); }; },