Set text color based on luminance
color_text_by_luminance.Rd
Useful for applying one or another of text colors based on the luminance of a background
Arguments
- colors
chr
of css colors- text_light
chr
CSS color for light text- text_dark
chr
CSS color for dark text
See also
Other color:
color_cycle()
,
color_distance()
,
color_luminance()
,
color_match()
,
color_rgb_table()
,
color_separate()
,
colors2css()
,
css_col2vec()
,
luminance_filter()
,
rgb2hex()
Examples
color_text_by_luminance(c("white", "magenta", "red", "brown", "yellow"))
#> [1] "black" "white" "white" "white" "black"