d3 interpolators vs. ColorBrewer single hue sequential scales

Have you ever wondered to which extent you could emulate the beautiful ColorBrewer single hue sequential colour schemes with some form of linear interpolation between the endpoints? Wonder no more!

I made you a d3 example (see here for the gist) comparing the ColorBrewer sequential single hue schemes Blues, Greens, Oranges, Purples and Reds with the d3 L*a*b*, HCL, RGB and HSL interpolators. Click on the image to go to the bl.ock and see all of the colours.

Colourmap blues.
Colourmap blues.

(To my eyes, it looks like the straight-forward, non-perceptual, HSL ordering gives the closest results for most of the schemes.)

3 thoughts on “d3 interpolators vs. ColorBrewer single hue sequential scales”

  1. You could set d3.range(9) as domain and use the 9 colorbrewer swatches as range. Then choose one of the interpolators. In this way you have the best of both worlds: colorbrewer colors and a continuous scale.

    I will post an example bl.ock with an elaborated overview of colorbrewer/d3js comparisons if I have time.

Leave a Reply

Your email address will not be published. Required fields are marked *