make_palette | R Documentation |
This function will generate colour palettes of arbitrary size from an R base graphics color function, ColorBrewer named palette, color-hex.com palette ID or vector of named or hex colours. Also, a source image file (png or jpeg) or url can be used. Defaults to a nice Tableau-esque Orange->Blue divering or Stephen Few-esque Earth->Emerald...
make_palette(
colour = NULL,
n = 7,
reverse = FALSE,
shuffle = FALSE,
default = TRUE
)
colour |
colour(s) to be turned into a palette |
n |
numeric the number of colours to be returned |
reverse |
logical should the return palette order be reversed? |
shuffle |
logical should the return palette be shuffled? |
default |
logical should default palette be Tableau-esque orange-blue diverging? |
list object containing palette and plot
### Brewer Colour Palette
make_palette(colour = 'Spectral')
### color-hex.com palette ID
make_palette(colour = 1010612)
make_palette(colour = 1040526)
### Custom Colour Vector
my_colours <- c("#CAF60D", "#18D33A", "#4255EC", "#E60873", "#19312A")
make_palette(colour = my_colours)
### Sample Source Image
make_palette(colour = "https://www.r-project.org/Rlogo.png")
### Default Behaviour
make_palette(default = TRUE)
make_palette(default = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.