New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New method: deltas()
#437
Comments
I realized that we claim to calculate ΔH but are in fact calculating Δh (the angle, not the length of the arc). What this means is that we over-emphasize the difference for near-neutrals and under-emphasize it for high chroma colors. But yes a general method that gives the set of deltas is probably better and likely faster if the user calculates each one separately. |
Oh that's really interesting. That would explain a lot in the GMA app. |
It also strikes me that, for Οklab, calculating these gets you most the way to DeltaE OK and so there is a risk that these get calculated twice, for the common case where you want ΔΕ ΔL ΔC and ΔH. So I wonder if deltas should return an array of four items rather than 3. But then, this is not the case at all for complex formulae like ΔE2000 so perhaps not. Note too the optimization in ΔECMC: let H2 = (Δa ** 2) + (Δb ** 2) - (ΔC ** 2); and then ΔH is ΔE = Math.sqrt((ΔL ** 2) + (Δa ** 2) + (Δb ** 2)) which can be further optimized by keeping the values of those squares around rather than calculating them twice. |
When working on the gamut mapping playground recently, I needed to calculate deltas in OKLCh (differences per component) and ended up doing so by hand.
This seems like a more generally useful function. We have
distance()
and a bunch ofdeltaE()
methods, but nothing that is done per-component.What do you think?
The text was updated successfully, but these errors were encountered: