hcl.colors2: Color Palettes

hcl.colors2R Documentation

Color Palettes

Description

Create a vector of n contiguous colors.

Usage

hcl.colors2(n, palette = "viridis", start = 0, end = if (palette %in%
    special.palettes) (n - 1)/n else 1, alpha, rev = FALSE)

inferno.colors(n, start = 0, end = 1, alpha, rev = FALSE)
plasma.colors(n, start = 0, end = 1, alpha, rev = FALSE)
viridis.colors(n, start = 0, end = 1, alpha, rev = FALSE)

gg.colors(n, start = 0, end = (n - 1)/n, alpha, rev = FALSE)

show.colors(x)

Arguments

n

the number of colors (\ge 1) to be in the palette.

palette

a valid palette name (one of hcl.pals()). The name is matched to the list of available palettes, ignoring upper vs. lower case, spaces, dashes, etc. in the matching.

alpha

an alpha-transparency level in the range [0,1] (0 means transparent and 1 means opaque).

rev

logical indicating whether the ordering of the colors should be reversed.

start

a number in the range [0,1] at which the vector of colors begins.

end

a number in the range [0,1] at which the vector of colors ends.

x

a vector of colors to display.

Details

hcl.colors2 is a variant of hcl.colors that adds a start and end argument. hcl.colors2 is slightly faster than hcl.colors, though it is not by much.

Value

For show.colors, its argument.

For all others, a character vector of n hex color codes.

Examples

show.colors(hcl.colors2(256, palette = "Spectral"))


show.colors(inferno.colors(256))
show.colors(plasma.colors(256))
show.colors(viridis.colors(256, end = 0.9))


show.colors(gg.colors(256))

ArcadeAntics/essentials documentation built on Nov. 7, 2024, 4:33 p.m.