is.color: Checks if a string is a valid color

View source: R/yogitools.R

is.colorR Documentation

Checks if a string is a valid color

Description

Given a character vector, this function will check whether each element in the vector is a valid color descriptor, such as "black", "chartreuse2", or "#ff0000"

Usage

is.color(str)

Arguments

str

a character vector

Value

a logical vector of the same length indicating which elements are valid colors

References

http://stackoverflow.com/questions/13289009/check-if-character-string-is-a-valid-color-representation/13290832#13290832

Examples

is.color(c(NA, "black", "blackk", "1", "#00", "#000000"))

jweile/yogitools documentation built on May 11, 2023, 7:42 p.m.