in_hex: Fast casting of colors into HEX strings

View source: R/in_hex.R

in_hexR Documentation

Fast casting of colors into HEX strings

Description

Convert colors, including named ones as defined in the function colors, into their hex representation. This function is mostly used internally by chroma.

Usage

in_hex(x)

Arguments

x

vector of colors specified as hex strings or named R colors.

Value

A vector of colors specified as hex codes

See Also

hex for the same functionality offered in a more standard and more versatile way (albeit slower).

Examples

in_hex("pink")
in_hex(c("pink", "#348A31", "darkblue"))
in_hex(c("pink", NA))
show_col(in_hex(colors()))

jiho/chroma documentation built on Nov. 26, 2022, 2:39 a.m.