xl_color: Normalize a color to a libxlsxwriter RGB integer
Description
Converts an R color name (e.g. `"navy"`), a hex string (`"#FF0000"` or
`"FF0000"`), or an integer in the range `0x000000`..`0xFFFFFF` into the
single `0xRRGGBB` integer that libxlsxwriter expects. Used internally by
every `color`/`background`/`foreground` argument of the formatting
constructors, and exported so it can be used directly.
Usage
xl_color(x)
Value
A single integer in `0x000000`..`0xFFFFFF`, or `NA_integer_`.
Arguments
x
A single color: an R color name, a hex string, or an integer.
`NA` returns `NA_integer_` (an unset color).
See Also
Other cell formatting:
is_xl_format(),
xl_format(),
xl_format_groups