Skip to content
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

Color32 from hex value #1492

Closed
kkharji opened this issue Apr 13, 2022 · 1 comment · Fixed by #1596
Closed

Color32 from hex value #1492

kkharji opened this issue Apr 13, 2022 · 1 comment · Fixed by #1596
Labels
feature New feature or request

Comments

@kkharji
Copy link
Contributor

kkharji commented Apr 13, 2022

Is your feature request related to a problem? Please describe.

Most of the time when implementing a UI design, colors comes in hex values. Having to manually convert hex to RGBA is kind tedious and time consuming.

Describe the solution you'd like

new method in Color32

Color32::from_hex("#0d1117")
@kkharji kkharji added the feature New feature or request label Apr 13, 2022
@emilk
Copy link
Owner

emilk commented Apr 13, 2022

This would be nice - especially if it could be a const fn or macro, so any typos could be caught at compile time.

I think what we would want to support is only the #rrggbb and #rrggbbaa formats, not the other weird CSS formats

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
2 participants