doypa_palette {DOYPAColors} | R Documentation |
This function creates a function that generates a color vector or ramp of n colors for a specified DOYPAColors palette.
doypa_palette(palette = NULL, reverse = FALSE, ramp = FALSE)
palette |
Character string specifying the desired palette name. Available palettes: list_doypa_pals(). |
reverse |
Logical. If 'TRUE', reverses the order of colors in the palette. |
ramp |
Logical. If 'TRUE', the returned function generates a color ramp (interpolation) instead of a vector of colors. |
A function that generates a vector of 'n' colors or a color ramp.
# Create a function for generating colors from the "buzz" palette
get_buzz_palette <- doypa_palette(palette = "buzz")
colors <- get_buzz_palette(5)
preview_doypa_pals(colors = colors, palette = "buzz")