R/color_check.R

Defines functions color_check

#' This is a function used to assess if a string is a color 
#' 
#' @importFrom grDevices col2rgb
#' @noRd
color_check <- function(x) {
  sapply(x, function(X) {
    tryCatch(is.matrix(col2rgb(X)), 
             error = function(e) FALSE)
  })
}
etc5523-2020/r-package-assessment-samuellyu-2021 documentation built on Jan. 1, 2021, 1:13 a.m.