Skip to contents

Converts a nested list of palette choices into a single-level named list where each entry is a character vector of colors.

Usage

flatten_palette_options(palettes)

Arguments

palettes

A named list of palettes or nested category lists.

Value

A flattened named list of palettes.

Author

Jared Andrews

Examples

pal_lookup <- flatten_palette_options(default_palettes()[["choices"]])
head(names(pal_lookup))
#> [1] "dittoColors"      "dittoColors_full" "ggplot2"          "viridis"         
#> [5] "magma"            "inferno"