In R, I can easily generate a color ramp, for example colorRampPalette. The following produces a sequence of five colors, from blue to red:
> mypal <- colo
You can try
> colorRampPalette(c('blue', 'red'))(length(x))[rank(x)] [1] "#0000FF" "#FF0000" "#CC0032" "#3300CC" "#660099" "#990065"