-
Notifications
You must be signed in to change notification settings - Fork 77
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
Alpha channel for color behaves inconsistently between web and desktop #606
Comments
That's... interesting! I'll read the specs on blending for WebGL vs Desktop GL to see if there's anything that jumps out at me. I hope this is an easy fix but I can't promise that it will be. |
So... here is an interesting one. I decided to check the difference for myself mostly because I was curious and although the build for native looks quite similar to what is on the right. When I use cargo web to build for the web the square seems to become green Also, if I change the background color to white, the square becomes yellow instead. Browser:76.0.1 (64-bit) In order to produce this, I simply cloned quicksilver and changed the 01_example to contain the above mentioned code. |
Pretty sure this is caused by the alpha-blending happening against the web-page. If you change the body element's background color to white and run some code that draws a semi-transparent black square over a sprite then the sprite will be blended with white. If you change the body element's background colour to black and repeat the process, the sprite will be blended with black. |
Both issues here should be resolved by ryanisaacg/blinds#28: the alpha should show up the same on desktop and web, and the canvas should not be blended with the page background. |
Let me know if either of these issues crop up after you upgrade dependencies, but the new blinds version should take care of them. |
Description
![obraz](https://user-images.githubusercontent.com/45723292/81461184-436e6e80-91aa-11ea-90a3-d5cfe3fa2fc9.png)
Using Color::with_alpha on web and locally produces different results as illustrated on image below:
Left rectangle - web
Right rectangle - desktop application
To Reproduce
Background color is
Color::CYAN
.Rectangle is created using:
Environment and versions:
The text was updated successfully, but these errors were encountered: