Description Usage Arguments Value Examples
Selects whether black or white has the greater contrast with a user-
supplied color. Useful for choosing a text color to overlay on a block-color
background, like value labels over the bars of a bar chart. Calculated as per
cr_get_ratio
. Defaults to black in the case of a tie.
1 | cr_choose_bw(col_bg)
|
col_bg |
A character vector of colors against which to select either
black or white, whichever has maximum contrast. Supply colors as
six-digit hex values preceded by '#', or named colors from
|
A character vector of values "black" or "white". The length matches the input.
1 | cr_choose_bw(c("white", "gray90", "gray50", "gray10", "black"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.