Closed LeaVerou closed 1 month ago
Shouldn't this have special handling for hues?
Shouldn't this have special handling for hues?
Yes, as I said earlier
I envisioned this as a low-level utility function, if users want to make this optimization for hue it's trivial to do so on the deltas returned.
That said, it should definitely constrain the ΔH returned in some way (possibly by also preserving the original). We shouldn't have a color with a hue of 350 and a color with a hue of 0 appear to have a ΔΗ of 350. It seems like this could follow shorter hue, possibly even take an argument for it.
Ok, I’ve made several improvements:
"shorter"
being the default.none
handling, and added more tests.We could have another option for scaling the Δh by taking C/L into account, but not sure how that would work in a generic way.
Looks good to me. I would fix lint issues. related to the files in questions.
✅ Deploy Preview for colorjs ready!
Toggle QR Code...
Use your smartphone camera to open QR code link.
To edit notification comments on pull requests, go to your Netlify site configuration.