pal_palette: Colour palettes

View source: R/palette.R

pal_paletteR Documentation

Colour palettes

Description

This creates a list of colour vectors.

Usage

pal_palette(...)

is_palette(x)

as_palette(x)

Arguments

...
  • For pal_palette(): A named list of character vectors of any of the three kinds of R colour specifications, or a named list of colour vectors of class palettes_colour.

x
  • For as_palette(): An object to be coerced.

  • For is_palette(): An object to test.

Details

Colours can be specified using either:

  • Hexadecimal strings of the form "#RRGGBB" or "#RRGGBBAA"

  • Colour names from grDevices::colors()

  • Positive integers i that index into grDevices::palette()⁠[i]⁠

Value

An S3 list of class palettes_palette.

See Also

pal_colour()

Examples

pal_palette(
  Egypt = c("#DD5129", "#0F7BA2", "#43B284", "#FAB255"),
  Java  = c("#663171", "#CF3A36", "#EA7428", "#E2998A", "#0C7156")
)

x <- list(
  Egypt = c("#DD5129", "#0F7BA2", "#43B284", "#FAB255"),
  Java  = c("#663171", "#CF3A36", "#EA7428", "#E2998A", "#0C7156")
)
as_palette(x)

palettes documentation built on Sept. 11, 2024, 5:57 p.m.