Returns the text color (dark or light) with the higher WCAG contrast
ratio against each background color. Useful for labels placed on colored
fills, e.g. in ggplot2::geom_text().
See also
ekio_contrast() for the underlying contrast ratios
Examples
ekio_text_on(ekio_pal("blue")["700"])
#> 700
#> "white"
ekio_text_on(ekio_pal("blue"))
#> 100 200 300 400 500 600 700 800 900
#> "black" "black" "black" "black" "white" "white" "white" "white" "white"
ekio_text_on(ekio_pal("full"), dark = ekio_pal("gray")["900"])
#> [1] "white" "#191A1C" "white" "#191A1C" "white" "white" "white"
#> [8] "#191A1C"
