View source: R/util_make_palette.R
util_make_palette | R Documentation |
Make a specially-formatted color palette based on color codes.
util_make_palette(colors, continuous = length(colors) < 5,
divergent = length(colors) > 2, polynomial = FALSE, degrees = 6,
pad = 10, name = "custom", preview = TRUE, print = TRUE)
colors |
A vector of color names or HEX codes, or a matrix-like object with colors in columns, and their RGB values in separate rows. |
continuous |
Logical; if |
divergent |
Logical; if |
polynomial |
Logical; if |
degrees |
Number of polynomial degrees, if |
pad |
If |
name |
Name of the palette. |
preview |
Logical; if |
print |
Logical; if |
An invisible list of the created palette.
# a discrete palette
util_make_palette(c("red", "green", "blue"), FALSE)
# a continuous palette
util_make_palette("red")
# a divergent continuous palette
util_make_palette(c("red", "green"), divergent = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.