paletteer_d: Get discrete palette by package and name

View source: R/paletteer_d.R

paletteer_dR Documentation

Get discrete palette by package and name

Description

Available package/palette combinations are available in the data.frame palettes_d_names.

Usage

paletteer_d(
  palette,
  n,
  direction = 1,
  type = c("discrete", "continuous"),
  call = caller_env(0)
)

Arguments

palette

Name of palette as a string. Must be on the form packagename::palettename.

n

Number of colors desired. If omitted, returns complete palette.

direction

Either 1 or -1. If -1 the palette will be reversed.

type

Either "discrete" or "continuous". Colors are interpolated if "continuous" is picked. Defaults to "discrete".

call

The execution environment of a currently running function, e.g. caller_env(). The function will be mentioned in error messages as the source of the error. See the call argument of abort() for more information.

Value

A vector of colors.

Examples

paletteer_d("nord::frost")
paletteer_d("wesanderson::Royal1", 3)
paletteer_d("Redmonder::dPBIPuOr", 14, type = "continuous")

paletteer documentation built on Jan. 8, 2026, 9:10 a.m.