diff --git a/wled00/data/index.js b/wled00/data/index.js index d9c64bdfbf..41801b995d 100644 --- a/wled00/data/index.js +++ b/wled00/data/index.js @@ -26,6 +26,7 @@ var pmt = 1, pmtLS = 0, pmtLast = 0; var lastinfo = {}; var isM = false, mw = 0, mh=0; var ws, wsRpt=0; +var lastIntermediateColorUpdate = new Date(); var cfg = { theme:{base:"dark", bg:{url:"", rnd: false, rndGrayscale: false, rndBlur: false}, alpha:{bg:0.6,tab:0.8}, color:{bg:""}}, comp :{colors:{picker: true, rgb: false, quick: true, hex: false}, @@ -275,6 +276,7 @@ function onLoad() handleLocationHash(); cpick.on("input:end", () => {setColor(1);}); cpick.on("color:change", () => {updatePSliders()}); + cpick.on("color:change", () => {updateIntermediateColor()}); pmtLS = localStorage.getItem('wledPmt'); // Load initial data @@ -2592,6 +2594,14 @@ function updatePSliders() { gId('sliderK').value = cpick.color.kelvin; } +function updateIntermediateColor() { + const now = new Date(); + if (now - lastIntermediateColorUpdate > 500) { + lastIntermediateColorUpdate = now; + setColor(1); + } +} + function hexEnter() { if(event.keyCode == 13) fromHex();