View source: R/contrastColors.R
contrastColors | R Documentation |
For a given set of colors, contrastColors
returns an associated set
of colors.
contrastColors(colors, how = "how_borw", alpha = FALSE) col2Hex(colors, alpha = FALSE)
colors |
vector of any of the three kinds of R color specifications,
see |
how |
a method to contrast |
alpha |
logical value indicating whether the alpha channel (opacity) values should be returned. |
Based on the sum of colors' saturation how_borw
returns black or white,
how_prop
proportionally remove or add some saturation. how_oppo
opposes the color (255-x) and how_cent
centers the columns, i.e. remove
or add 127.
contrastColors()
: Retuns a set of colors contrasted.
col2Hex()
: Returns the hexadecimal string associates to a given vector of colors.
grDevices::col2rgb()
contrastColors("blue") contrastColors("blue", how = "how_prop")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.