rgb2hex: Convert RGB to hex

Description Usage Arguments Examples

View source: R/rgb2hex.r

Description

Enter a list of RGB color codes, or R colors, and get the appropriate hex color code.

Usage

1
rgb2hex(rgbcode = NULL, rcolor = NULL)

Arguments

rgbcode

List of rgb color codes, each list must be a vector of three objects representing the three components of rgb color code from 0 - 255. This can be a named list where the name represents the name of the color to be used.

rcolor

An unnamed list of R color names.

Examples

1
2
3
4
rgb2hex(rcolor = list("sienna2", "thistle1"))
rgb2hex(rcolor = list("sienna2", "thistle1"), rgbcode = list('orange' = c(238, 74, 24), 
'raw umber' = c(113, 75, 35)))
rgb2hex(rgbcode = list('orange' = c(238, 74, 24), 'raw umber' = c(113, 75, 35)))

Example output

         HexCodes
sienna2    EE7942
thistle1   FFE1FF
          HexCodes
orange      EE4A18
raw umber   714B23
sienna2     EE7942
thistle1    FFE1FF
          HexCodes
orange      EE4A18
raw umber   714B23

highlightHTML documentation built on April 21, 2020, 5:06 p.m.