You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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().
To see the color output from the function as it is converted from the oklch() function: remove line 281 from the demo above
// boost C value a little bit, since chroma-js doesn't convert hex to oklch exactly 1-to-1if(i===1)returnn*100+(n===0 ? 0 : 39);
Currently it's boosted by 39 to match the hex color more closely, but originally it doesn't match
The text was updated successfully, but these errors were encountered:
shipurjan
changed the title
color returned by the oklch() function does not match CSS
color returned by the oklch() function does not match input color space CSS
Mar 12, 2024
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
The text was updated successfully, but these errors were encountered: