You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to the particular HCL hue of achromatic colors (~ 158.2° in the current implementation of d3-color), when interpolating a chromatic and achromatic color, the non-zero Chroma of the interpolated color will pick up various hues.
In comparison, chroma.js will not interpolate the hue in this case, with a more predictable (and analogous to Lab) outcome:
Should interpolateHcl behave the same?
The text was updated successfully, but these errors were encountered:
The bug here (if there is one, and I think there is) is that the hue for white (or another achromatic color) is a number rather than NaN. If the hue is NaN then the interpolator will do the right thing.
Previously I thought that the non-NaN (NNaN) hue for white was an artifact of the D65 referent but it seems I was mistaken. We should fix this as part of your work to make d3.lab and d3.lch consistent with other implementations.
(Also would be great to implement chroma clamping…)
Interpolating
red
andwhite
in Lab and HCL:Due to the particular HCL hue of achromatic colors (~ 158.2° in the current implementation of d3-color), when interpolating a chromatic and achromatic color, the non-zero Chroma of the interpolated color will pick up various hues.
In comparison, chroma.js will not interpolate the hue in this case, with a more predictable (and analogous to Lab) outcome:
Should interpolateHcl behave the same?
The text was updated successfully, but these errors were encountered: