R/string.R
is_color_hex.Rd
Validates hex color codes in #RGB, #RGBA, #RRGGBB, or #RRGGBBAA format.
#RGB
#RGBA
#RRGGBB
#RRGGBBAA
is_color_hex(x)
(any) Object to check.
any
TRUE if x is a valid hex color string, FALSE otherwise.
TRUE
x
FALSE
https://www.w3.org/TR/css-color-4/#hex-notation
is_color_hex("#FF5733") #> [1] TRUE is_color_hex("#fff") #> [1] TRUE