is_valid_color: Check the color

Description Usage Arguments Value Examples

Description

Check whether a vector element is a valid color.

Usage

1

Arguments

x

a any type color string or a javascript color object specifying.

Value

Return a logic vector indicating whether the color is valid.

Examples

1
2
3
4
5
6
7
is_valid_color("blue")
x <- "{ h: 0.5, s: 0.5, l: 0.5 }"
is_valid_color(x)
y <- c("{ r: 1, g: 0, b: 0 }", "{ h: 0.5, s: 0.5, v: 0.5 }")
is_valid_color(y)
is_valid_color(c(NA, "red"))
is_valid_color("not a color")

houyunhuang/tinycolor documentation built on June 6, 2019, 7:43 p.m.