Hacker News new | past | comments | ask | show | jobs | submit login

Not quite—you can choose a ramp that will remain in-gamut for sRGB, eg try shifting hue here:

https://oklch.com/#72.67,0.121,240.19,100

Even if you were to use a more saturated ramp, I suspect that discontinuities due to gamut mapping with a good algorithm[1] should be less than the discontinuities due to lightness and chroma shifts in HSL, but I could be wrong.

[1] https://bottosson.github.io/posts/gamutclipping/




Ah yeah, I only checked the path between sRGB #0000ff = oklch(45.2% 0.3131 264.05) and sRGB #00ff00 = oklch(86.64% 0.2948 142.50) which surely needs out-of-gamut colors. And as you have noticed from the post, there are many algorithms to handle them with different attributes of colors to preserve. CSS even has its own algorithm [1] that primarily keeps hue and lightness but allows slight alternations to avoid excessive reduction on edge cases. For the purpose of this test though, hues should be probably preserved at any cost.

While lower saturation may solve this problem, some colors do greatly depend on saturation to be correctly perceived, like brown, so I don't think it is not ideal to change that either.

[1] https://www.w3.org/TR/css-color-4/#css-gamut-mapping




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: