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

const fn for Color::from_rgba8 #77

Open
jeffreyrosenbluth opened this issue Apr 25, 2023 · 4 comments
Open

const fn for Color::from_rgba8 #77

jeffreyrosenbluth opened this issue Apr 25, 2023 · 4 comments

Comments

@jeffreyrosenbluth
Copy link

It would be nice to have a const version of this so it is possible to create color names in an application.

@RazrFalcon
Copy link
Owner

RazrFalcon commented Apr 26, 2023

Will take a look. Does float operations already const in Rust?

@Woodman3
Copy link

emmm,it still not,but i think const fn is stil should be add

@RazrFalcon
Copy link
Owner

It will be added when I would have time.

@Woodman3
Copy link

Woodman3 commented Jun 2, 2024

I have see the source code and find it seem not easy to do it . Because from_rgba use NormalizedF32:new_u8() and this function is also not const. And to make this function constable it may use f32::from::<u8>() but it is also not constable...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants