-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feat: colors convert from hex #1493
Conversation
fix: resulting colors are incorrect |
@emilk 🤔 that's odd one test fail with thread 'color::test_to_hex_to_rgba' panicked at 'assertion failed: `(left == right)`
left: `Color32([20, 1, 7, 2])`,
right: `Color32([245, 40, 145, 255])`', epaint/src/color.rs:587:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace I explicitly set rgba to btw 2 because I wanted |
let rgba = Color32::from_rgba_unmultiplied(245, 40, 145, 2); | ||
let hex = Color32::from_hex("#f5289133").unwrap(); | ||
assert_eq!(rgba, hex); |
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.
let rgba = Color32::from_rgba_unmultiplied(245, 40, 145, 2); | |
let hex = Color32::from_hex("#f5289133").unwrap(); | |
assert_eq!(rgba, hex); | |
let rgba = Color32::from_rgba_unmultiplied(0xf5, 0x28, 0x91, 0x33); | |
let hex = Color32::from_hex("#f5289133").unwrap(); | |
assert_eq!(rgba, hex); |
The benefit with a macro (e.g. |
Closed by #1596 |
Closes #1492