Skip to contents

Does the input contain hexadecimal colors?

Usage

isHexColor(x)

allAreHexColors(x)

Arguments

x

Object.

Value

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

Functions

  • isHexColor(): Vectorized.

  • allAreHexColors(): Scalar.

Note

Updated 2023-10-02.

See also

assertive::is_hex_color().

Examples

## TRUE ====
x <- viridis::viridis(n = 2L)
class(x)
#> [1] "character"
print(x)
#> [1] "#440154FF" "#FDE725FF"
isHexColor(x)
#> [1] TRUE TRUE

## FALSE ====
x <- ggplot2::scale_color_manual
class(x)
#> [1] "function"
isHexColor(x)
#> [1] FALSE