contrast | R Documentation |
This function determines the appropriate contrast colour (either dark or light) for a given set of colours.
contrast(colour, dark = "black", light = "white")
colour |
A character vector of colour names or hex codes. |
dark |
A character string specifying the colour to use for dark contrast (default is "black"). |
light |
A character string specifying the colour to use for light contrast (default is "white"). |
A character vector of the same length as 'colour', containing the contrast colours (either 'dark' or 'light').
contrast(c("grey20", "grey80"))
contrast(c("#000000", "#FFFFFF"), dark = "navy", light = "yellow")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.