get_palette: Retrieve a color palette from a collection

View source: R/get_palette.R

get_paletteR Documentation

Retrieve a color palette from a collection

Description

Access a named palette from a named collection. Supports discrete or continuous palettes.

Usage

get_palette(collection, palette, n = NULL, type = c("discrete", "continuous"))

Arguments

collection

Character name of the collection (e.g., "sb", "ohsu", "personal")

palette

Character name of the palette within the collection (e.g., "deep", "muted")

n

Number of colors to return. If NULL, returns all available colors.

type

One of "discrete" or "continuous".

Value

A character vector of hex color codes.

Examples

get_palette("sb", "deep")
get_palette("sb", "muted6", n = 3)
get_palette("sb", "deep", n = 100, type = "continuous")

emilelatour/laviz documentation built on June 13, 2025, 9:41 a.m.