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

[FEATURE] Color constructor with floats should have range 0 to 1 #17

Closed
nt314p opened this issue Sep 1, 2022 · 1 comment
Closed

[FEATURE] Color constructor with floats should have range 0 to 1 #17

nt314p opened this issue Sep 1, 2022 · 1 comment

Comments

@nt314p
Copy link

nt314p commented Sep 1, 2022

Is your feature request related to a problem? Please describe.
Usually when floats are used to represent colors, the color value ranges from 0 to 1, not 0 to 255.

Describe the solution you'd like
The color constructor which takes floats should assume the floats range from 0 to 1. To convert from these floats to the 0 to 255 byte values, simply multiply the float components by 255.9999 and then cast.

@Yeffian
Copy link
Member

Yeffian commented Sep 1, 2022

So basically, take the floats in from a range of 0 to 1, and convert to the standard 255 in bytes? I'll get to work on it after I get home, thanks for opening an issue!

@Yeffian Yeffian closed this as completed in fab5d66 Sep 1, 2022
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

2 participants