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
Working with Hex codes #148
Comments
Nothing concrete at the moment, apart from #144 being at the other end of the pipeline, but there's not really any particular reason against it. Do you have any specific input format/type in mind? Like a string or a u32? Does the component order matter? Also, just so it's not forgotten, if it's just for being able to input it in hex instead of decimal, it can always be broken up into u8 components: let color: Srgb<u8> = Srgb::new(0xFF, 0x00, 0xFF); |
I need to parse hex color strings in format "#ff00dd" and convert that to rgb. I can do the parsing / converting to rgb my self, I was just puzzled that working with hex colors wasn't more sought after. |
Sounds like a |
Yes, something like from_hex sounds great. At the end of the day, hex is rgb, just written in a different notation. The only problem is, you have to validate the input and "#fff" and "#ffffff" are the same thing. |
One issue is that you don't get an |
Oh, you are completely right! That must have been forgotten somewhere along the way. I'll report a separate issue for it, since this one is closed, and also make it a task to go through the other types and add it in there too. Just in case. Thanks for pointing it out! |
Are there any plans for adding support for hex format, specifically something like rgb::new(hex) ?
The text was updated successfully, but these errors were encountered: