mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-21 07:21:46 +01:00
fix(ColorPicker): update color conversion logic (#4550)
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user