rawr_palettes: rawr palettes

rawr_palettesR Documentation

rawr palettes

Description

Functions for generating and viewing color palettes.

Usage

rawr_palettes

rawr_pal(
  name,
  n = NULL,
  z = n,
  type = c("discrete", "continuous"),
  rev = FALSE
)

show_pal(x, n = Inf, fullrange = FALSE, counts = inherits(x, "imgpal"))

Arguments

name

the palette name, one of names(rawr_palettes) or an unambiguous abbreviation

n

the first n colors from the palette to use

z

for type = 'continuous', the number of colors to interpolate from the sequence of n palette colors

type

return a discrete or continuous (gradient) of colors

rev

logical; if TRUE, the palette is reversed

x

one of 1) a rawr_palette name; 2) a vector of two or more colors; 3) an imgpal object

fullrange

logical; for imgpal objects, if TRUE, the entire palette is shown; otherwise, only the unique colors (estimated from ImageMagick) are shown

counts

logical; for imgpal objects, if TRUE, the frequencies are shown for each color

Format

An object of class list of length 5.

See Also

imgpal; palette; colorRampPalette; wesanderson::wes_palettes; nord::nord_palettes; faulkner::faulkners

Examples

## some built-in palettes
rawr_palettes

## use or generate new palettes from existing
show_pal(rawr_pal('dfci'))
show_pal(rawr_pal('dfci', 4))
show_pal(rawr_pal('dfci', 4, 100, type = 'continuous'))

## view palettes from other sources
# show_pal(nord::nord_palettes$afternoon_prarie)
show_pal(rainbow(8))

## Not run: 
filled.contour(volcano, col = rawr_pal('dfci', 4, 21, type = 'c'))
filled.contour(volcano, col = rawr_pal('dfci', z = 21, type = 'c'))
filled.contour(volcano, col = rawr_pal('pokrie', 4, 21, type = 'c'))

## End(Not run)


raredd/rawr documentation built on April 29, 2024, 10:29 a.m.