get_col_palette | R Documentation |
Get color palette in the form of colorRampPalette color interpolation functions. Use with get_col_gradient() or get_element_colors() from this package.
get_col_palette(brew_pal = NA, custom = NA, rev = F)
brew_pal |
character string or NA. Exact name of RColorBrewer palette. e.g. "RdBu". |
custom |
Na or character vector with colors specifying palette order. e.g. c("red", "white", "blue"). Any hex codes or R colors (see colors()) can be used. |
rev |
logical; should the brew_pal color palette order be reversed? |
Only one of the parameters (brew_pal or custom) must be specified (not NA), otherwise function will use custom only.
A colorRampPalette color interpolation functions.
get_col_palette(brew_pal = "RdBu") colorRampPalette(RColorBrewer::brewer.pal(9, "RdBu")) #' # Reverse the palette (i.e. blue to red) get_col_palette(brew_pal = "RdBu", rev = T)
get_col_palette(custom = c("forestgreen", "darkorchid4")) colorRampPalette(c("forestgreen", "darkorchid4"))
colorRampPalette function from grDevices. See ?colorRampPalette.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.