3 ms·
It's a pretty common technique to use HSL and some simple math to do this with CSS, but even if you use a perceptually uniform color space, colors of different
by bastawhiz 4y ago
It's a pretty common technique to use HSL and some simple math to do this with CSS, but even if you use a perceptually uniform color space, colors of different hues but similar chroma/value doesn't ensure accessible contrast. It also means that in the naive case, your colors end up being very "rainbow" -y.
Stripe's color system blog post gets into the nitty gritty of getting this right, at least for curated colors: https://stripe.com/blog/accessible-color-systems https://stripe.com/blog/accessible-color-systems