black_or_white | R Documentation |
Chose black or white color based on a color to be used as background.
Usefull when using geom_text
on top of tiles or bars, or
geom_label
with a variable fill.
black_or_white(colors, threshold = 0.45)
colors |
character A vector of color definitions. |
threshold |
numeric in range 0 to 1. |
black_or_white("red")
black_or_white(colors()[1:10])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.