Skip to contents

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.

Value

An S3 list of class palettes_palette.

Details

Colours can be specified using either:

See also

Examples

pal_palette(
  Egypt = c("#DD5129", "#0F7BA2", "#43B284", "#FAB255"),
  Java  = c("#663171", "#CF3A36", "#EA7428", "#E2998A", "#0C7156")
)
#> <palettes_palette[2]>
#> $Egypt
#> <palettes_colour[4]>
#>  #DD5129
#>  #0F7BA2
#>  #43B284
#>  #FAB255
#> 
#> $Java
#> <palettes_colour[5]>
#>  #663171
#>  #CF3A36
#>  #EA7428
#>  #E2998A
#>  #0C7156
#> 

x <- list(
  Egypt = c("#DD5129", "#0F7BA2", "#43B284", "#FAB255"),
  Java  = c("#663171", "#CF3A36", "#EA7428", "#E2998A", "#0C7156")
)
as_palette(x)
#> <palettes_palette[2]>
#> $Egypt
#> <palettes_colour[4]>
#>  #DD5129
#>  #0F7BA2
#>  #43B284
#>  #FAB255
#> 
#> $Java
#> <palettes_colour[5]>
#>  #663171
#>  #CF3A36
#>  #EA7428
#>  #E2998A
#>  #0C7156
#>