I'm not sure if it's actually a problem, maybe they can't be converted between each other perfectly, but I'm adding this issue just in case
Problem:
In CSS a color like #ef4444 (HEX) or rgb(239 68 68) (RGB) does not produce the same perceived color converted to OKLCH with function chroma('#ef4444').oklch().
I'm not sure if it's actually a problem, maybe they can't be converted between each other perfectly, but I'm adding this issue just in case
Problem:
In CSS a color like
#ef4444
(HEX) orrgb(239 68 68)
(RGB) does not produce the same perceived color converted to OKLCH with functionchroma('#ef4444').oklch()
.Demo:
https://codesandbox.io/p/sandbox/oklch-hsl-rgb-color-space-comparison-c6gtyn?file=%2Fsrc%2FApp.tsx
To see the color output from the function as it is converted from the
oklch()
function: remove line 281 from the demo aboveCurrently it's boosted by 39 to match the hex color more closely, but originally it doesn't match