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