This function takes an integer n and a character scheme and returns a
character vector of n colours from the specified colour scheme. The
function supports four colour schemes from Paul Tol ("tol_bright",
"tol_vibrant", "tol_muted", "tol_light", "tol_rainbow") and Color Universal Design ("cud"
scheme). If the scheme argument is a vector of colours, the function will
return the first n colours from that vector, repeating the vector if it has
fewer than n colours. If the scheme argument is not a valid colour scheme
or a vector of colours, the function will throw an error. Use of
get_sp_colors() is valid too.
Arguments
- n
integer number of colours to return
- scheme
character name, colour scheme to use Choose from one of four palettes from Paul Tol ("tol_bright", "tol_vibrant", "tol_muted", "tol_light", "tol_rainbow"), or Color Universal Design ("cud"). Or a vector of colours, e.g. c("#FF0000", "green", "#0000FF").
- order
optional ordering of the colours: NULL (default, no change), "reverse", "random" (the order used is printed), or an integer vector that is a permutation of 1:n, e.g. c(2, 1, 3). Note that c(1, 5, 3, 4, 2, 6, 7) works well.
