l_colorName: Get Color Names from the Hex Code

Description Usage Arguments Value Examples

View source: R/l_ColorList.R

Description

Return the built-in color names by the given hex code.

Usage

1
l_colorName(color, error = TRUE)

Arguments

color

A vector of 12 digit (tcl) or 6 (8 with transparency) digit color hex code, e.g. "#FFFF00000000", "#FF0000"

error

Suppose the input is not a valid color, if TRUE, an error will be returned; else the input vector will be returned.

Value

A vector of built-in color names

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
l_colorName(c("#FFFF00000000", "#FF00FF", "blue"))

## Not run: 
# an error will be returned
l_colorName(c("foo", "bar", "red"))

# c("foo", "bar", "red") will be returned
l_colorName(c("foo", "bar", "#FFFF00000000"), error = FALSE)

## End(Not run)

loon documentation built on June 14, 2021, 9:07 a.m.