R code for hierarchical color palettes