dot-isValidColor: Check for valid color specification.

.isValidColorR Documentation

Check for valid color specification.

Description

Check if the elements of a numeric or character vector are valid colors understood by R.

Usage

.isValidColor(x)

Arguments

x

numeric or character vector with color specifications.

Details

This is an internal function, used for example by valueToColor. The elements of x are check for valid color specifications by passing them to col2rgb and checking for an exception.

Value

A logical vector of the same length as x.

Author(s)

Michael Stadler

Examples

swissknife:::.isValidColor(c("black", "blackk"))
swissknife:::.isValidColor(c(-1, 1))


fmicompbio/swissknife documentation built on June 11, 2025, 4:17 p.m.