Closure to generate a color palette picker, given an input palette
Source:R/colors.R
fed_color_pal.Rd
This internal function will take as an input either a) the name of a palete (
one of fsr_primary_colors
, fsr_secondary_colors
, or bsvr_color
)
or b) the palette itself as a vector of hex codes representing the colors.
In turn, it will return a function f(n)
that produces a vector
containing the first n
colors of the input palette.
Optionally, it can use the input palette to generate a color ramp, so
it can produce as many colors as required.
Arguments
- palette
Character name of palette in fed_color_palettes
- use_ramp
Boolean indicating whether to use a color ramp to interpolate colors (via grDevices::colorRampPalette)
- reverse
Boolean indicating whether the palette should be reversed
- ...
Additional arguments to pass to
colorRampPalette()