From c9fa762f9bfe180e5bb78a4c41bf9a400d25ad87 Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 18 Jul 2024 15:41:58 +0200 Subject: [PATCH] Fix ColorPicker saturation and value being swapped --- src/ui/ColorPicker.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ui/ColorPicker.tsx b/src/ui/ColorPicker.tsx index dfd581c..d040eb9 100644 --- a/src/ui/ColorPicker.tsx +++ b/src/ui/ColorPicker.tsx @@ -134,8 +134,8 @@ export function ColorPicker({ const x = e.clientX - rect.left; const y = e.clientY - rect.top; - const v = x / rect.width; - const s = 1 - y / rect.height; + const s = x / rect.width; + const v = 1 - y / rect.height; setHSV(hsvColor.h, s, v); }} @@ -149,8 +149,8 @@ export function ColorPicker({ ).href } style={{ - top: `${100 - hsvColor.s * 100}%`, - left: `${hsvColor.v * 100}%` + top: `${100 - hsvColor.v * 100}%`, + left: `${hsvColor.s * 100}%` }} draggable={false} >