is.color: Check whether input is a valid color

Description Usage Arguments Value See Also Examples

Description

is.color checks whether or not the given input is a valid color

is.hex.color checks whether input is a valid hex color (with or without alpha component)

is.named.color checks whether input is a valid named color

Usage

1
2
3
4
5
is.color(x, allow_alpha = TRUE)

is.hex.color(x, allow_alpha = TRUE)

is.named.color(x)

Arguments

x

Vector containing either:

  1. a color name (see colors)

  2. a hexadecimal string of the form "#rrggbb" or "#rrggbbaa"(see rgb)

allow_alpha

Whether or not alpha parameters are allowed in hex color strings (default: TRUE)

Value

Boolean indicating whether or not the given input is a valid color

See Also

colors

Examples

1
2
is.color('turquoise2')
is.hex.color('#8BADF00D')

briandconnelly/colormod documentation built on May 13, 2019, 5:13 a.m.