color: oklab(from var(--color) calc(round((1 - l))) 0 0);
one of my favorite tricks with the new css color stuff. this automatically gives you white or black text, whichever contrasts best with --color
@unascribed til there's levels of css colors
@unascribed it sounds very made up which I suppose it is
@noiob yeah CSS got split into modules after/during CSS3, so now each module has its own "level"
we're on Colors Module Level 5 at present