d3/d3-interpolate

d3.interpolateHcl(a,b)(1) doesn't return 'b'

akrawitz opened this issue · 3 comments

Apologies if I'm misunderstanding how these interpolators should work, but I would have assumed that the end point should always be reached when t = 1.

A call to:
d3.interpolateHcl('red', 'white')(1)
returns:
"rgb(255, 178, 123)"
when I would expect it to return:
"rgb(255, 255, 255)"

Please see https://observablehq.com/@akrawitz/d3-interpolatehcl for a demo.

Thank you! That does provide a work around. However, note that I left a comment in that notebook about an inconsistency between the text and the code (or maybe I'm still not quite getting it).(Edit: Already fixed!)

The text was wrong and I’ve corrected it.