as_tibble.palettes_colour {palettes}R Documentation

Cast colour vectors and colour palettes to tibbles

Description

as_tibble() turns an existing colour vector or colour palette into a so-called tibble, a data frame with class tbl_df.

Usage

## S3 method for class 'palettes_colour'
as_tibble(x, ...)

## S3 method for class 'palettes_palette'
as_tibble(x, ...)

Arguments

x

An object of class palettes_palette or palettes_colour.

...

Not used.

Value

A tibble. The output has the following properties:

See Also

pal_colour(), pal_palette()

Examples

x <- pal_colour(c("#663171", "#EA7428", "#0C7156"))
as_tibble(x)

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

[Package palettes version 0.2.0 Index]