Skip to contents

Useful for applying one or another of text colors based on the luminance of a background

Usage

color_text_by_luminance(colors, text_light = "white", text_dark = "black")

Arguments

colors

chr of css colors

text_light

chr CSS color for light text

text_dark

chr CSS color for dark text

Value

chr CSS text colors

Examples

color_text_by_luminance(c("white", "magenta", "red", "brown", "yellow"))
#> [1] "black" "white" "white" "white" "black"