Takes a color input as x
and returns either the black or white color (or
expression) if dark or light text should be used over the input color for
best contrast. Follows W3C Recommendations.
choose_dark_or_light(x, black = "#000", white = "#FFF")
The background color
Text or foreground color, e.g. "#222" or
substitute(darken_color(x, 0.8))
, if black text provides the best contrast.
Text or foreground color or expression, e.g. "#EEE" or
substitute(lighten_color(x, 0.8))
, if white text provides the best contrast.