Skip to contents

Validates hex color codes in #RGB, #RGBA, #RRGGBB, or #RRGGBBAA format.

Usage

is_color_hex(x)

Arguments

x

(any)
Object to check.

Value

TRUE if x is a valid hex color string, FALSE otherwise.

Examples

is_color_hex("#FF5733")
#> [1] TRUE
is_color_hex("#fff")
#> [1] TRUE