par(mfcol=c(2,2))
tmp <- 1:3
names(tmp) <- c('red','green','blue')
barplot(tmp, col=c('red','green','blue'))
barplot(tmp, col=ColToGrey(c('red','green','blue')))
barplot(tmp, col=c('red','#008100','#3636ff'))
barplot(tmp, col=ColToGrey(c('red','#008100','#3636ff')))
Run the code above in your browser using DataLab