Skip to contents

palettes is an R package for working with colour vectors and colour palettes. There are three main goals to the palettes package, each described in a vignette:

  • To provide a new family of colour classes (palettes_colour and palettes_palette) that always print as hex codes with colour previews; vignette("palettes").

  • To provide a comprehensive library of methods for working with colour vectors and colour palettes, including methods for ggplot2, vignette("ggplot2"); gt, vignette("gt"); biscale, vignette("biscale"); and other colour packages, vignette("compatibility").

  • To make it easy for anyone to make their own colour palette package; vignette("creating-packages"). Colour palette packages made with palettes exist solely for the purpose of distributing colour palettes and get access to all the features of palettes for free.


Install palettes from CRAN with:


Install the development version from GitHub or R-universe with:

# Install from GitHub
# install.packages("remotes")

# Install from R-universe
install.packages('palettes', repos = '')


Colours can be specified by name (as listed by grDevices::colours()):


Or by hex code:


Multiple colours can be specified at once as a character vector:

pal_colour(c("#a00e00", "#d04e00", "#f6c200", "#0086a8", "#132b69"))

Named colour palettes can be specified in the same way:

  egypt = c("#dd5129", "#0f7ba2", "#43b284", "#fab255"),
  java  = c("#663171", "#cf3a36", "#ea7428", "#e2998a", "#0c7156")

Colours also print nicely in tibbles:

as_tibble(pal_colour(c("#dd5129", "#0f7ba2", "#43b284", "#fab255")))


See at and also in the installed package: help(package = "palettes").


MIT © Michael McCarthy