make_palette: make_palette

View source: R/make_palette.R

make_paletteR Documentation

make_palette

Description

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...

Usage

make_palette(
  colour = NULL,
  n = 7,
  reverse = FALSE,
  shuffle = FALSE,
  default = TRUE
)

Arguments

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?

Value

list object containing palette and plot

Examples


### 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)


onehundredpercenttexan/colourgen documentation built on Feb. 6, 2024, 7:30 a.m.