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);
I spent hours exploring the color ranges where APCA and WCAG2 contrast algorithms differ. Then I found a site that shows these discrepancies, with the gray area of the chart marking the disagreement range. That's the zone Ariakit Styles will avoid. Thank you so much, Lloyd Kupchanko!
4 reposts35 likes