-
Notifications
You must be signed in to change notification settings - Fork 106
Description
All the interpolators based on an array of 9 or 11 values result in colors that are a bit duller than the original values. Using a Catmull-Rom interpolation (preferably L*a*b, but RGB is almost undistinguishable) would make them all vivid again:
the three bands below represent the array, the current interpolator, and the proposed change for RdYlBu

See all the others at https://observablehq.com/@fil/interpolate-colors-with-catmull-rom
The catmull-rom interpolator would be added to d3-interpolate; Matt Deslauriers’s version, which I use here, is coming from the Three.js codebase and operates in 3D. I think we would want to change its API a bit to work for any dimension (at least d = 1, 2, 3), but I haven't checked that part yet.
EDIT: a monotone interpolator seems smaller and faster, with comparable results (see below).