Serge Ø
insilico.bsky.social
Serge Ø
@insilico.bsky.social
Pu-erh driven software engineer https://github.com/hcz
Reposted by Serge Ø
Here's the math needed to adjust a color's lightness and eliminate the gray area where WCAG2 and APCA conflict on black/white foregrounds.

Yes, it's CSS. And yes, it's blazingly fast.

Usage:

background: oklch⁠(⁠from⁠ ⁠<⁠color⁠>⁠ ⁠var⁠(⁠-⁠-⁠_⁠ak⁠-⁠safe⁠-⁠l⁠)⁠ ⁠c⁠ ⁠h⁠)⁠;
February 15, 2025 at 7:46 PM