R Colors

R’s green, gray and purple names map to different HEX values from their CSS counterparts.

No items found.

colors() lists R’s built-in names. In R, green is #00FF00, gray is #BEBEBE and purple is #A020F0. The R color-name documentation explains their use with col=.

Use names with col=

palette <- c("steelblue", "tomato", "gold")
barplot(c(4, 7, 5), col = palette, names.arg = palette)

# Inspect the RGB components of built-in names
col2rgb(c("green", "gray", "purple"))
R Colors swatches: red, blue, green, gray, purple, orange, pink, gold, tomato.

Shades

Palettes

No items found.