From bc3caf7764ca511b36350cbe83cd8ce4e0eb26d3 Mon Sep 17 00:00:00 2001 From: Robert Kossessa Date: Mon, 20 May 2024 16:28:09 +0200 Subject: [PATCH] FIX: LED Colors (in hsv now) --- src/renderer/src/colorToLED.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/renderer/src/colorToLED.ts b/src/renderer/src/colorToLED.ts index b4383f3..b8169fe 100644 --- a/src/renderer/src/colorToLED.ts +++ b/src/renderer/src/colorToLED.ts @@ -2,8 +2,8 @@ import Color from 'color' export const colorToLED = (color: Color) => { if (!color) return null - const l = color.lightness() - if (l < 0.5) return color.lightness(0) - const nl = 1 - Math.pow(l / 50 - 1, 4) - return color.lightness(nl * 35 + 20) + const l = color.value() + if (l < 1) return color + const nl = 1 - Math.pow(l / 100 - 1, 2) + return color.value(nl * 70 + 30) }