-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Unexpected colours from BlendFoo() #11
Comments
Thank you, great report! Since only Hsv (you don't want to use that) and Hcl are wrong, and only for some second colors, it indicates the error probably lies in one of these angular branches. I'll have a look. |
I found what I think is a better (and hopefully correct) formula for angular interpolation. I don't remember where I got the original from or if I made it up myself, but it was wrong for some pairs of angles. I added unit-tests based on your snippet, but it only tests that both extremes of the interpolation are correct, which they now are. I'm not sure where I could get values from for testing intermediate values during the interpolation, if you know a trustworthy source we could add another table-based test for that. But anyways, please give the new code a try and let me know. Feel free to reopen this issue should you find more interpolation problems! |
Added some more tests in a follow-up commit so we can be a little more confident that it's correct now 😄 |
I'd expect all these to print
#1a1a46
, but they don't. I does matter what colour c2 is, so I think this would take some broader testing initially. Also, for example c1 as#1a1a00
gives yields expected result.The text was updated successfully, but these errors were encountered: