I want to get the hexadecimal color codes that the scale_fill_grey function scale_fill_grey to populate the categories of barcode generated by the following codes:
library(ggplot2) data <- data.frame( Meal = factor(c("Breakfast","Lunch","Dinner","Snacks"), levels=c("Breakfast","Lunch","Dinner","Snacks")), Cost = c(9.75,13,19,10.20)) ggplot(data=data, aes(x=Meal, y=Cost, fill=Meal)) + geom_bar(stat="identity") + scale_fill_grey(start=0.8, end=0.2)

source share