Convert R colors to Hexadecimal

Usage

col2hex(rcolor)

Arguments

rcolor
A character string taken from R's built-in color names.

Value

Returns a character string of converted hexadecimal colors.

Description

Convert R colors() to Hexadecimal.

Examples

col2hex("darkblue")
[1] "#00008B"
col2hex(c("darkblue", "red"))
[1] "#00008B" "#FF0000"
cat(paste0("
"))

See also

colors, rgb, col2rgb