col2hex {bittermelon}R Documentation

Colors to standardized hex strings

Description

col2hex() standardizes R color strings into a unique RGBA hex string. All fully transparent colors get standardized to "#FFFFFF00".

Usage

col2hex(x)

Arguments

x

Color value as supported by grDevices::col2rgb().

Value

A standardized RGBA hex string (as returned by grDevices::rgb()).

Examples

col2hex("red")
col2hex("green")
col2hex("blue")
col2hex("transparent")
col2hex(NA_character_)
col2hex("#00000000")

[Package bittermelon version 2.0.2 Index]