get_lut: Retrieve one or more of color specifications as hex, rgb...

View source: R/misc.R

get_lutR Documentation

Retrieve one or more of color specifications as hex, rgb triplets or a data.frame

Description

Retrieve one or more of color specifications as hex, rgb triplets or a data.frame

Usage

get_lut(LUT, index, form = c("hex", "rgb", "data.frame")[1], name = FALSE)

Arguments

LUT

a color look-up table data frame. See link{GLASBEYLUT}, link{WADLUT}, link{KELLYLUT} and link{BOYNTONLUT}.

index

a vector of numeric or character indices to retrieve colors, if missing then all are returned. If the look-up table has row names, then one can use those for indexing.

form

character, either 'hex', 'rgb' or 'data.frame'

name

logical, ignored if form is 'data.frame'

Value

color values in the form specified

hex

a character vector of hexidecimal strings, this is the default

rgb

a 3-column matrix of red, green and blue values

data.frame

a 4 column data frame, see GLASBEYLUT

Examples

lut <- get_lut(WADLUT, 3:16, form = 'hex', name = TRUE)
plot(3:16, pch = 19, col = lut, cex = 3)

btupper/catecolors documentation built on Sept. 22, 2023, 12:40 p.m.