Generate a color palette for a vector of values
utils-get_color_palette.RdThis function returns a named vector of colors corresponding to the unique
values in x. If the number of unique values is less than or equal to
the length of main_colors, it selects the first n colors from
main_colors. Otherwise, it generates a palette of n colors
interpolated from main_colors.
Usage
get_color_palette(
x,
template = "inrae",
main_colors = get_color_template(template, cfg),
cfg = loadConfig()
)Arguments
- x
A vector of values for which a color palette is needed.
- template
character The name of the theme template to apply.
- main_colors
A character vector of color names or hex codes to use as the base palette.
- cfg
a config object. Configuration to use. See loadConfig for details