palettes | R Documentation |
Returns a vector of hex color values for a specified color palette.
palettes(index = NULL, type = "colorblind", plot = FALSE)
index |
An optional vector of integers or color names to extract a subset of colors from the specified palette. |
type |
The color palette to return. Options include...
|
plot |
Logical; if |
A character vector of hex color values for the specified palette.
# List of possible inputs to argument
# 'type' for each palette
palettes()
# Plot of colors in each palette
palettes("Colorblind", plot = TRUE)
palettes("Grayscale", plot = TRUE)
# Example of taking subset of colors
palettes("Colorblind", 1:2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.