-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add hex constructors for Color #375
Comments
You can currently write: let color1 = Color::from_rgb8(0x32, 0x80, 0xC8);
let color2 = Color::from_rgba8(0x32, 0x80, 0xC8, 0.44); A constructor like However, I think we could add |
Well, I'm usually copying and pasting the hex values straight from an external program like Inkscape. It is cumbersome to have to constantly reformat it every time I want to check how it looks in the app. |
Actually, yeah, |
You could create your own helper function: fn inkscape_color(value: u32) -> iced::Color { /* ... */ }
Yes. It feels wrong to mention |
Oh yeah, I could write my own helper function. It would be nice just to have this in iced at some point though. Other people using iced may want the same thing but not know how to write that specific helper function. |
It would be nice to add a feature to create colors from a single hexadecimal number like this:
The code could be something like this:
The text was updated successfully, but these errors were encountered: