-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OKLCH support #125
Comments
HCT was specifically developed for superior perceptual accuracy (material design blog). I also found a comparison between HCT, OKLCH, and sRGB color spaces which is a good visual demonstration of how HCT is at worst on-par with OKLCH, and is typically better. Note that while the rendered CSS uses RGB notation, the color math used to arrive at these values is done within the different color spaces. I'm not affiliated with Google or the Material Foundation, but I'm very confident in assuming that this project will stick to HCT and will not drop down to OKLCH. |
I've played around with the https://hct-test.pages.dev demo and, unfortunately, I didn't see any cases where HCT is better than OKLCH. Could you please share screenshots of such cases? The most important advantage of OKLCH over HCT is that OKLCH is supported by browsers natively. Also, OKLCH compared to HCT doesn't require complicated math. This means that OKLCH doesn't require complex libraries like the @media (prefers-color-scheme: light) {
color: blue;
}
@media (prefers-color-scheme: dark) {
color: oklch(from blue calc(l + 25) c h);
} See some experiments by @rodydavis: https://codepen.io/collection/MgQRKw. 😉 Moreover, OKLCH color model supports not only sRGB color space, but also wide-gamut color spaces (P3, Rec2020 and beyond). See https://evilmartians.com/chronicles/oklch-in-css-why-quit-rgb-hsl. :root {
--accent: oklch(70% 0.2 145);
}
+ @media (color-gamut: p3) {
+ :root {
+ --accent: oklch(70% 0.29 145);
+ }
+ } You can play around with https://oklch.com to construct colors that can't be displayed on displays that doesn't support P3/Rec2020 or on any existing device. Not sure if HCT supports wide gamut (colors beyond sRGB) or not. |
I've opened #131. |
Adding @jpohhhh, who works on color at Google, to this discussion. |
For those of us who've invested a significant amount of time learning and integrating HCT, I hope we stay the course unless the results are significantly worse via data and testing. |
Is there plans to move over to OKLCH instead of the weird HCT color space?
cc @pennzht
The text was updated successfully, but these errors were encountered: