R/isColor.R

Defines functions isColor

# Copied from a post by Josh O'Brien on Stack Overflow:
# https://stackoverflow.com/questions/13289009/check-if-character-string-is-a-valid-color-representation
isColor <- function(x) {
  sapply(x, \(X) {
    tryCatch(is.matrix(grDevices::col2rgb(X)), error = function(e) FALSE)
  })
}

Try the seqHMM package in your browser

Any scripts or data that you put into this service are public.

seqHMM documentation built on June 8, 2025, 10:16 a.m.