This assert check is intended primarily to check for RColorBrewer or viridis hexadecimal color value return.

isHexColorFunction(x, nullOK = FALSE, .xname = getNameInParent(x))

Arguments

x

Object.

nullOK

logical(1). If set to TRUE, x may also be NULL.

.xname

Not intended to be used directly.

Value

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

See also

RColorBrewer, viridis packages.

Examples

## TRUE ==== x <- viridis::viridis isHexColorFunction(x)
#> [1] TRUE
## FALSE ==== x <- ggplot2::scale_colour_manual isHexColorFunction(x)
#> [1] FALSE #> Cause of failure: #> Hex color function must contain an `n` formal argument.