R’s green, gray and purple names map to different HEX values from their CSS counterparts.
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=.
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"))