Skip to contents

detect valid R color

Usage

isColor(x, makeNamesFunc = c, ...)

Arguments

x

character vector of potential R colors

makeNamesFunc

function used to make names for the resulting vector

...

additional parameters are ignored

Value

logical vector with length(x).

Details

This function determines whether each element in a vector is a valid R color, based upon the R color names, valid hex color format, and the word "transparent" which is valid as an R color.

Examples

isColor(c("red", "blue", "beige", "#99000099", "#aa00ff", "#AAE", "bleh"))
#>       red      blue     beige #99000099   #aa00ff      #AAE      bleh 
#>      TRUE      TRUE      TRUE      TRUE      TRUE      TRUE     FALSE