Implemented STD Gamma II interpolator
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,
Thanks! Here's what it gives on my screen:

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

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:
- keep it reversed code-wise, but change the link in documentation (change the reference to https://adriaandokter.com/bioRad/#vertical-profile-data-example since they were my inspiration and the ones that decided first to reverse the IDL scale)
- reverse the code output so we match IDL's initial idea and the current documentation (I'll adapt my project to reverse it before use)
Any preference?
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.
Thanks for the quick feedback, @Fil!
A few random comments:
- I de-reversed the interpolator, in case you eventually choose to add it!
- I was also concerned about the addition of the
d3-scalerequirement. I actually contemplated reimplementing a simple piecewise linear scales in pure JS to avoid that situation, but I came to the conclusion that the reinventing the wheel was worse than importing another nice D3 tool. Tell me if I'm wrong. - I also understand the main question: should this repository become a comprehensive archive of color schemes. Good question, and I think you're in a better position than me to make this call :) From my point of view as a newbie D3 user: it would be nice to have somewhere a single entry point (repository of color schemes / interpolators that we can quickly browse when we need to choose a color scheme for a project). And I naively/lazily assumed it was this repo since it's what we immediately get when googling terms such as "D3 color scales".
Anyway, thanks already for your work and for considering this!