Skip to contents

Convert color name to hexadecimal

Usage

col2hex(color_name)

Arguments

color_name

Character. Color name recognized by R.

Value

Character. Hexadecimal color code.

Examples

col2hex("forestgreen")
#> [1] "#228B22"
col2hex("blue")
#> [1] "#0000FF"