Re:Accessible Palette: stop using HSL for color systems
by zokier on Tuesday August 29, 2023 @10:34AM
(#37308560)
In addition to missing oklab/oklch, the article is also wrong in claiming web/css supports only srgb; css color() function supports many colorspaces
[ Parent
| on HN ]
Re:Accessible Palette: stop using HSL for color systems
by altairprime on Tuesday August 29, 2023 @12:02PM
(#37309881)
Note that CSS Color Module Level 4 is still at the Recommendation Draft stage, and "supports" here is more accurately stated as "supports, except for Microsoft Edge (chromium) and Pale Moon (goanna)":
https://test.csswg.org/harness/results/css-color-4_dev/group...
Re:Accessible Palette: stop using HSL for color systems
by jcranmer on Tuesday August 29, 2023 @01:49PM
(#37311409)
https://caniuse.com/css-lch-lab is probably a better resource for support, and it notes that the main layout engines all supported it earlier this year, and gives an estimated global support rate of ~85%.
Re:Accessible Palette: stop using HSL for color systems
by altairprime on Tuesday August 29, 2023 @03:19PM
(#37312538)
sRGB/ProPhoto/DCI-P3 and HSL/HSLuv/Lch/Lab/OKLab are two distinct sets of functionality. The former defines the colorspaces (such as sRGB), the latter defines colors within a given colorspace. To see a visual demo of this, visit https://oklch.com/#70,0.1,165,100 and enable Show P3 and Show Rec2020; two additional thin white lines will be added showing the colorspace truncation points for the OKLCH color (70% 0.1 165).
https://caniuse.com/css-color-function tracks support for the colorspaces, complementing the above link for Lch/Lab, and showing essentially the same current data: All desktop and the two top mobile browsers now support it.
I'm really glad to see this. Thank you for sharing. That makes me much more optimistic about what will come of this.
(Note that all browsers are currently failing LCH and OKLCH tests 9 and 10, and Firefox failing 15% of the CSS Color v4 parsing tests, at https://wpt.fyi/results/css/css-color?label=experimental&lab... — but this is still a page full of great success for CSS Color v4! So happy.)
Re:Accessible Palette: stop using HSL for color systems
by whoopsie on Tuesday August 29, 2023 @12:17PM
(#37310132)
Personally worked with oklab and several other LAB spaces. Oklab is fantastic for cutting into simple computations!
Re:Accessible Palette: stop using HSL for color systems
by efedorenko on Tuesday August 29, 2023 @12:46PM
(#37310534)
Author here. The article was published 2 years ago, and when I started working on the tool the spec for OkLCH didn't even come out yet (late Dec 2020). Today I'd choose OkLCH over LCH as it solves a few problems with it.
Re:Accessible Palette: stop using HSL for color systems
by mbo on Tuesday August 29, 2023 @10:43PM
(#37317037)
Here's a color model built on Oklch, but instead of lightness uses APCA’s (WCAG 3) contrast ratio: https://github.com/antiflasher/apcach