Does the input contain hexadecimal colors?

isHexColor(x, .xname = getNameInParent(x))

allAreHexColors(x, .xname = getNameInParent(x))

Arguments

x

Object.

.xname

Name of object defined in x. Not intended to be used directly.

Value

TRUE on success; FALSE on failure, with cause set.

Functions

  • isHexColor: Vectorized.

  • allAreHexColors: Scalar.

Note

Updated 2019-08-10.

See also

Examples

## TRUE ==== x <- viridis::viridis(n = 2L) class(x)
#> [1] "character"
#> [1] "#440154FF" "#FDE725FF"
isHexColor(x)
#> #440154FF #FDE725FF #> TRUE TRUE
## FALSE ==== x <- ggplot2::scale_color_manual class(x)
#> [1] "function"
isHexColor(x)
#> [1] FALSE #> Cause: 'x' is not character.