From 0add9cb00337841e3ba580ed324998714a408cf6 Mon Sep 17 00:00:00 2001 From: Kuba Orlik Date: Sat, 30 Dec 2023 14:21:45 +0100 Subject: [PATCH] Fix wrong color --- light-loop.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/light-loop.js b/light-loop.js index 159c6d2..734743a 100644 --- a/light-loop.js +++ b/light-loop.js @@ -17,14 +17,10 @@ async function send_color(light_data, color, max_brightness, debug) { if (light_data.type == "rgb") { body.rgb_color = color; - body.brightness = Math.floor( - Math.max(...latest_color.get()) * max_brightness - ); + body.brightness = Math.floor(Math.max(...color) * max_brightness); } else { // body.brightness = Math.max(1, Math.round(255 * brightness)); // 0 seems to turn it off and make it slower to react - body.brightness = Math.floor( - Math.max(...latest_color.get()) * max_brightness - ); + body.brightness = Math.floor(Math.max(...color) * max_brightness); } if (debug) {