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

Color.hex_color is returning alpha in wrong position (first instead of last) #21

Open
Brow71189 opened this issue Nov 18, 2022 · 5 comments

Comments

@Brow71189
Copy link
Contributor

Try something like Color.Color('rgba(255, 0, 0, 0.5)').to_rgba_255()
I would expect this to return (255, 0, 0, 127) but instead I get (127, 255, 0, 0).

@Brow71189
Copy link
Contributor Author

Additionally I think it is strange that you have to specify the alpha channel in the interval 0-1 instead of 0-255 and converting to "rgba" then returns it in the 0-255 interval.

@cmeyer
Copy link
Collaborator

cmeyer commented Nov 18, 2022

I'll take a look at the bug, but the color is just working off the CSS spec, although only a subset:

@cmeyer cmeyer changed the title Color class is not self-consistent Color.hex_color is returning alpha in wrong position (first instead of last) Nov 18, 2022
@cmeyer cmeyer self-assigned this Nov 18, 2022
@cmeyer
Copy link
Collaborator

cmeyer commented Nov 18, 2022

I assume you're using a background color with transparency? (I think that's the only place where this would show up...)

@Brow71189
Copy link
Contributor Author

Exactly. And there is doesn't work because you simply get a white background instead.
Following the CSS spec is nice, but I think our own color class should work with our own UI, otherwise it is not that useful.

@Brow71189
Copy link
Contributor Author

Maybe the bug should be in "nionui" then and we need to change the "set_background" method to adhere to the CSS spec?

@cmeyer cmeyer removed their assignment Nov 21, 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