-
Notifications
You must be signed in to change notification settings - Fork 757
Description
If invert (optionally) depended on the value of background-color #4611 and was added to other properties than outline-color, but perhaps not to the <color> type itself, there would be some other useful color keywords defined in a similar way:
white-or-blackequalsblackif the value ofbackground-colorhas a CIE lightness of more than 40%, otherwise it equalswhiteblack-or-whiteequalswhiteif the value ofbackground-colorhas a CIE lightness of less than 60%, otherwise it equalsblack
I am not sure whether they should depend on the specified, computed, actual or used value. The thresholds of 40% and 60% are chosen arbitrarily; with 50% there would be no need for two different keywords.
This could be used, for instance, in color swatch tables where the background shows the sample color and the text gives the color name or code value, and it would thus ensure readability.
Perhaps there could also be a point made in favor of current-or-black and current-or-white keywords, which would not depend on the absolute lightness of the background color but on the contrast ratio between that and currentcolor.