Bgcolor with transparent alpha value has strange behavior
grant-wilson opened this issue · 7 comments
Pts behaves strangely when the bgcolor is transparent. The canvas slowly darkens and visual artifacts appear.
This can be demonstrated with this simple demo.
pts_demo.zip
Hi @grant-wilson -- you can use "transparent"
or false
to set the bgcolor instead of an rgba value. Eg:
space.setup( {bgcolor: "transparent"} );
Alternatively, you can clear the canvas by calling space.clear("transparent")
when needed.
I just realize the CanvasSpace's setup
documentation was truncated so the parameters were hidden. I will fix it asap.
Thanks!
Hi @williamngan ,
Thank you for the quick reply.
You are right that using the color name "transparent"
works great!
This is exactly what I needed.
However I would argue that the behavior seen when using an rgba value with an alpha less than ff is probably not intended.
You can see what happens by running the pts_demo.html file I attached.
I have updated the title to reflect more clearly what I am talking about.
Thanks @grant-wilson. I see what you mean now -- that's a good catch. I will try to fix it in the next release.
In the meantime, you can call space.clear( "transparent" )
and then draw a semi-transparent rect that fills the canvas as a temporary fix.
Not sure if should be separate issue, but it falls under same heading, so I thought it was worth mentioning here.
While "transparent" does work, using false for bgcolor does not seem to work. (Contradicts the documentation.)
pts_demo.zip
Thanks for report this @jperrett256 -- this looks like a regression and we will fix it in the next patch release!
@jperrett256 - this should be fixed in v0.10.4. Thanks again for reporting the issue.
Closing this issue now. Please reopen if there're still issues.