-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
Color improvements #77
Conversation
Thank you! Feel free to add the assertions too! |
That would require the check float >= 1.0, which is non trivial to do. Are you okay with adding a dependency on approx? Or do you know another solution |
What's wrong with |
Exact equality is not possible with floats, it won't even compile in rust since floats only implement PartialEq |
Hmm... My compiler doesn't seem to complain about this: assert!(0.0 >= r, r <= 1.0);
assert!(0.0 >= g, g <= 1.0);
assert!(0.0 >= b, b <= 1.0);
assert!(0.0 >= a, a <= 1.0); I understand precision issues are a thing, but I am not sure if we should be worrying about that here. AFAIK, both |
Oh that's weird? I have no idea why that is the case. Maybe 1.0 is special cased? |
A type implementing only |
Should |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Thank you 🎉
Fixes #74.