Set text color based on luminance
color_text_by_luminance.RdUseful for applying one or another of text colors based on the luminance of a background
Arguments
- colors
chrof css colors- text_light
chrCSS color for light text- text_dark
chrCSS 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"