viz_palette: Show a palette

View source: R/utils.R

viz_paletteR Documentation

Show a palette

Description

Display a single palette to see whether it meets your needs. If no num parameter is given, all the colors in the palette will be displayed. If num is less than the number of colors in the palette, then only the first num colors will be displayed. If num is greater than the number of colors in the palette, then that many colors will be generated by linear interpolation over the vector of colors in the chosen palette.

Usage

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

Arguments

pal

character, vector of (hexadecimal) colors representing a palette

ttl

character, title to be displayed (the name of the palette)

num

numeric, the number of colors to display

Examples

viz_palette(mn_palettes$accent)
viz_palette(mn_palettes$accent, "accent: first 4", num = 4)
viz_palette(mn_palettes$accent, "accent: interpolated to 25", num = 25)


MPCA-data/mncolors documentation built on Feb. 3, 2024, 11:37 a.m.