| assert_all_are_hex_colors {assertive.data} | R Documentation |
Checks that the input contains hexadecimal colors.
assert_all_are_hex_colors(x, na_ignore = FALSE,
severity = getOption("assertive.severity", "stop"))
assert_any_are_hex_colors(x, na_ignore = FALSE,
severity = getOption("assertive.severity", "stop"))
assert_all_are_hex_colours(x, na_ignore = FALSE,
severity = getOption("assertive.severity", "stop"))
assert_any_are_hex_colours(x, na_ignore = FALSE,
severity = getOption("assertive.severity", "stop"))
is_hex_color(x)
is_hex_colour(x)
x |
Input to check. |
na_ignore |
A logical value. If |
severity |
How severe should the consequences of the assertion be?
Either |
A logical vector that is TRUE when the input contains hex
colours.
A string is considered to represent a hexadecimal colour when contains a hash followed by six hex values. That is, digits or the letters from a to f (case insensitive).
x <- c( "#012345", "#789abc", "#defDEF", #ok "012345", #no hash "#g12345", #bad letter "#01 23 45", #contains spaces "#12345", "#1234567" #wrong length ) is_hex_color(x) assert_any_are_hex_colors(x) #These examples should fail. assertive.base::dont_stop(assert_all_are_hex_colors(x))