R Language colorspace - click&drag interface for colors


Example

The package colorspace provides GUI for selecting a palette. On the call of choose_palette() function the following window pops-up:

enter image description here

When the palette is chosen, just hit OK and do not forget to store the output in a variable, e.g. pal.

pal <- choose_palette()

The output is a function that takes n (number) as input and produces a color vector of length n according to the selected palette.

pal(10)
[1] "#023FA5" "#6371AF" "#959CC3" "#BEC1D4" "#DBDCE0" "#E0DBDC" "#D6BCC0" "#C6909A" "#AE5A6D" "#8E063B"