viz_palette: Show a single palette

Description Usage Arguments Examples

View source: R/viz_pallete.R

Description

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.

Usage

1
viz_palette(pal, ttl = deparse(substitute(pal)), num = length(pal))

Arguments

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

Examples

1
2
3
4
5
6
viz_palette(ochre_palettes$namatjira_qual)
viz_palette(ochre_palettes$namatjira_qual, "namatjira_qual")
viz_palette(ochre_palettes$namatjira_qual, "namatjira_qual first 4",
            num = 4)
viz_palette(ochre_palettes$namatjira_qual,
            "namatjira_qual interpolated to 25", num = 25)

EdwinTh/paletti documentation built on May 13, 2019, 10:59 p.m.