Using uniform one-dimensional b-splines to interpolate in RGB color space, we can convert a discrete color scheme to a continuous one. This shows the “PiYG” scheme from ColorBrewer which has eleven original colors. This scale, and many more, are available in d3-scale-chromatic.
https://d3js.org/d3.v4.min.js