col2hex: Colors to standardized hex strings

View source: R/utils-color.R

col2hexR 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")

bittermelon documentation built on June 25, 2024, 5:09 p.m.