Skip to contents

Install from CRAN using:

install.packages("PrettyCols")

Or install the development version using:

remotes::install_github("nrennie/PrettyCols")

Then load into R:

To see the names of all available palettes, run:

names(PrettyColsPalettes)
#>  [1] "Blues"            "Purples"          "Tangerines"       "Greens"          
#>  [5] "Pinks"            "Teals"            "PurpleGreens"     "PinkGreens"      
#>  [9] "TangerineBlues"   "PurpleTangerines" "PurplePinks"      "TealGreens"      
#> [13] "Bold"             "Dark"             "Light"            "Neon"            
#> [17] "Relax"            "Autumn"           "Winter"           "Rainbow"         
#> [21] "Beach"            "Fun"

To see the colours in a specific palette, use the prettycols() function:

prettycols("Tangerines")

By default a discrete palette showing all colours is displayed. Setting type = "continuous" displays a continuous palette, changing n changes the number of colours, and switching direction = -1 reverses the order of colours. For example:

prettycols("Tangerines", n = 50, type = "continuous", direction = -1)

To see all available palettes, run:

or,

view_all_palettes(type == "all")

Palettes are categorised into three types:

  • Sequential (seq),
  • Diverging (div),
  • Qualitative (qual).

Palettes can be viewed by type. For example, to see all sequential colour palettes, run:

view_all_palettes(type = "seq")