Learn R Programming

loon (version 1.3.7)

l_colorName: Get Color Names from the Hex Code

Description

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

Usage

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

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab