viz_palette.Rd
Display a single palette to see whether it meets your needs.
If no num
parameter is given,
all the colours in the palette will be displayed.
If num
is less than the number of colours in the palette,
then only the first num
colours will be displayed.
If num
is greater than the number of colours in the palette,
then that many colours will be generated by linear interpolation
over the vector of colours in the chosen palette.
viz_palette(pal, ttl = deparse(substitute(pal)), num = length(pal))
pal | character, vector of (hexadecimal) colours representing a palette |
---|---|
ttl | character, title to be displayed (the name of the palette) |
num | numeric, the number of colours to display |
viz_palette(ocha_palettes$blue)viz_palette(ocha_palettes$tan, "tan")viz_palette(ocha_palettes$red, "Red first 4", num = 4)viz_palette(ocha_palettes$blue, "blue interpolated to 25", num = 25)