How about using scale_fill_brewer , which uses color palettes from the ColorBrewer website, which is implemented by RColorBrewer ?
ggplot(diamonds, aes(clarity, fill=cut) ) + geom_bar( ) + scale_fill_brewer( type = "div" , palette = "RdBu" )

There are several different diverging palettes you can choose.
require(RColorBrewer) ?brewer.pal
If you need more colors, you can use the colorRampPalette functions to interpolate between some colors (and I would use the brewer.pal palette for this). You can do it like this:
# Create a function to interpolate between some colours mypal <- colorRampPalette( brewer.pal( 6 , "RdBu" ) ) # Run function asking for 19 colours mypal(19) [1] "#B2182B" "#C2373A" "#D35749" "#E47658" "#F0936D" "#F4A989" "#F8BFA5" [8] "#FCD6C1" "#F3DDD0" "#E7E0DB" "#DAE2E6" "#CBE1EE" "#ADD1E5" "#90C0DB" [15] "#72AFD2" "#5B9DC9" "#478BBF" "#3478B5" "#2166AC"
In your example, which requires 8 colors, you use it like this: scale_fill_manual() :
PropBarPlot<-function(df, mytitle=""){ melteddf<-melt(df, id=names(df)[1], na.rm=T) ggplot(melteddf, aes_string(x=names(df)[1], y="value", fill="variable")) + geom_bar(position="fill") + theme(axis.text.x = element_text(angle=90, vjust=1)) + labs(title=mytitle)+ scale_fill_manual( values = mypal(8) ) } print(PropBarPlot(df))
source share