TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

OKLCH in CSS: why we moved from RGB and HSL

3 点作者 WallyFunk超过 2 年前

1 comment

rikroots超过 2 年前
I&#x27;m currently battling through the CSS Color Module spec[1] so I can add oklab() and oklch() defined colors to my 2d canvas library. My hope is that it will give me (and anyone else brave enough to use my library) better color ranges, gradients and (fingers crossed) filters - such as more accurate color reduction.<p>The question in my mind is: now we have oklab&#x2F;oklch, do I still need to care about CSS hsl&#x2F;hsla&#x2F;hwb&#x2F;lab&#x2F;lch colors? I&#x27;m tempted to dump them (except their convert to rgb code) to knock a few bytes from the library&#x27;s size...<p>[1] - <a href="https:&#x2F;&#x2F;www.w3.org&#x2F;TR&#x2F;css-color-4&#x2F;#lab-colors" rel="nofollow">https:&#x2F;&#x2F;www.w3.org&#x2F;TR&#x2F;css-color-4&#x2F;#lab-colors</a>