-
-
Notifications
You must be signed in to change notification settings - Fork 328
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
Tweak some comments and add a new from_hex_alpha
function
#841
base: master
Are you sure you want to change the base?
Conversation
.gitignore
Outdated
@@ -1,3 +1,38 @@ | |||
/target | |||
**/*.rs.bk | |||
# Generated by Cargo |
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.
This sneaked into the PR by accident, right? :) Could you please rebase it out?
/// assert_eq!(light_blue.b, 0.8352941); | ||
/// assert_eq!(light_blue.a, 0.5019608); | ||
/// ``` | ||
pub fn from_hex_alpha(hex: u32, alpha: u8) -> Color { |
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.
I do not have very strong opinion here, but it looks like #rrggbbaa
notation is fairly common. Maybe we should follow it to? Keep from_hex
#rrggbb
for the sake of backwards compatibility, while the new one will be 0xRRGGBBAA
?
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.
oops-- totally forgot that 32 bits has room for alpha. Will patch that in, stupid oversight on my part.
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.
It got room, the problem is that 0xff0000
is either red in from_hex
or very transparent green in from_hex_alpha
, which might be confusing. 0xAARRGGBB is a bit less error prone, but with #rrggbbaa being popular - even more confusing. So hex: u32, alpha: u8
actually does makes sense to me!
Undid tweaks to the gitignore to RustRover usage easier, by request
No description provided.