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
My colourscheme package on R-Forge does that:
https://r-forge.r-project.org/projects/colourscheme/
its primary purpose is to create functions that map numeric values (not just integer colour numbers) to colours. The vignette is the best documentation once you've got it installed.