A simple guide to show a selection of color schemes and palettes available in R

Color Theory

Selecting Colors

##  [1] "#00008B" "#46008B" "#8B008B" "#8B0046" "#8B0000" "#8B4500" "#8B8B00"
##  [8] "#468B00" "#008B00" "#008B45" "#008B8B" "#00468B"

## [1] "#00008B" "#46008B" "#00468B"

## [1] "#00008B" "#8B8B00"

## [1] "#00008B" "#8B0000" "#008B00"

## [1] "#00008B" "#8B008B" "#8B8B00" "#008B00"

## [1] "#00008B" "#8B0046" "#8B8B00" "#008B45"

## [1] "#00008B" "#8B4500" "#468B00"

##  [1] "#8B8B8BFF" "#84848BFF" "#7D7D8BFF" "#76768BFF" "#6F6F8BFF" "#68688BFF"
##  [7] "#61618BFF" "#5A5A8BFF" "#53538BFF" "#4C4C8BFF" "#46468BFF" "#3F3F8BFF"
## [13] "#38388BFF" "#31318BFF" "#2A2A8BFF" "#23238BFF" "#1C1C8BFF" "#15158BFF"
## [19] "#0E0E8BFF" "#07078BFF" "#00008BFF"

Hue Saturation Value (HSV) = Hue Saturation Brightness (HSB) Colour Space

  • A colour can be specified using R’s hsv() function that takes three arguments: hue, saturation, and value (brightness), all in the range [0, 1]

Hue Chroma Luminance (HCL) Colour Space

  • A colour can be specified using R’s hcl() function that takes three arguments: hue [0,360], chroma [0,100], and luminance [0,100]
  • This space is similar to the HSV space, however, in the HCL space steps of equal size correspond to approximately equal perceptual changes in colour
    • Note that the possible values of chroma and luminance actually depend on the specific hue; the ranges above are only indicative

Red Green Blue (RGB) Colour Space

  • RGB is the built-in colour space. Instead of “manually” creating a #RRGGBB colour string, a colour can be specified using R’s rgb() function that takes three arguments: red, green, and blue (which, by default, all have a range of [0, 1])

Color Palletes

RColorBrewer

Sequential Colors:

Color Blind Safe Sequential:

Qualitative Colors:

Color Blind Safe Qualitative:

Divergent:

Color Blind Safe Divergent:

Viridis

colorspace

wesanderson

wes_palette(name, n, type = c("discrete", "continuous"))
  • name: Name of desired palette
  • n: Number of colors desired. Unfortunately most palettes now only have 4 or 5 colors
  • type: Either “continuous” or “discrete”
    • Use continuous if you want to automatically interpolate between colours

Pirate Palette (yarrr)

ochRe

Dutch Masters

Ghibli

ggsci Colors

Discrete Colors

Continuous Colors

R inbuilt Colors

Standalones

Green

Blue

Brown

Yellow

Orange

Red

Pink

Purple

Gray / Grey

Offwhite