d3 / d3-scale-chromatic

Sequential, diverging and categorical color scales.
https://d3js.org/d3-scale-chromatic
Other
798 stars 107 forks source link

Implemented STD Gamma II interpolator #35

Open niconoe opened 3 years ago

niconoe commented 3 years ago

Hi,

I've recently had to implement a color scheme to mimic IDL's "Std Gamma II" color scale. I think it's nice to also share it with the community!

Thanks,

Fil commented 3 years ago

Thanks! Here's what it gives on my screen:

Capture d’écran 2021-04-16 à 10 10 36

It seems to be reversed wrt the original, is this expected?

niconoe commented 3 years ago

Good catch! Indeed, I implemented it reversed because that's also what the project I had to reimplement (bioRad) was doing.

I think we can either:

Any preference?

Fil commented 3 years ago

I don't know if we want to support this interpolator, it seems that it has quite a few issues in itself (like these very sharp bands on "pure" colors); and the implementation implies a structural change by requiring d3-scale (which might not be a problem, but is something new). But if we do, it will be better if wasn't reversed, so as not to add confusion. Note that this is not a reflection on its usefulness or quality of the contribution; there are lots of color interpolators that live outside the d3-scale-chromatic project, like Fabio Crameri's https://observablehq.com/@fil/colormaps https://observablehq.com/@nitaku/fabio-crameris-color-schemes . I would love to see a comprehensive archive of color schemes, but I wonder if that should be in this D3 module.

niconoe commented 3 years ago

Thanks for the quick feedback, @Fil!

A few random comments:

Anyway, thanks already for your work and for considering this!