fix(ColorPicker): update color conversion logic (#4550)

This commit is contained in:
Alex
2025-07-19 22:49:18 +05:00
committed by GitHub
parent e2695ee7e4
commit 6b6ec8cb2c
2 changed files with 7 additions and 4 deletions

View File

@@ -31,7 +31,7 @@ function HSVtoHSL(hsv: HSVColor): HSLObject {
return {
H: hsv.h,
S: x === 0 || x === 200 ? 0 : Math.round(hsv.s * hsv.v / (x <= 100 ? x : 200 - x)),
L: Math.round(x / 2)
L: x / 2
}
}
@@ -102,7 +102,6 @@ const pickedColor = computed<HSVColor>({
},
set(value) {
const color = new ColorTranslator(HSVtoHSL(value), {
decimals: 2,
labUnit: 'percent',
cmykUnit: 'percent',
cmykFunction: 'cmyk'