[squeak-dev] ColorForm with transparency not working properly
Thiede, Christoph
Christoph.Thiede at student.hpi.uni-potsdam.de
Sat Sep 19 18:36:53 UTC 2020
Hi all,
try out this:
m := Morph new color: (Color red alpha: 0.5).
m openInHand.
m imageForm openAsMorph.
Output:
[cid:b8fe602f-7ca6-47d9-bd34-b5b52440cad7]
And for completeness' sake, "m imageForm asMorph imageForm openAsMorph" appears just a bit darker again.
I traced the issue down to two methods: For the regular Morph, FormCanvas >> #setFillColor:, and for the ImageMorph, Canvas >> #translucentImage:at:sourceRect:. In both methods, at the end, the rule Form blend is used to draw the image. If I change it to Form over, the colors are the same and the issue seems to be fixed.
But unfortunately, I could not find any documentation about the different Form rules such as #blend, #over, #paint etc. Can you give me some pointers?
Also, I noted the comment in #translucentImage:at:sourceRect: which states:
"Draw a translucent image using the best available way of representing translucency.
Note: This will be fixed in the future."
Which workaround is this comment referring to?
Looking forward to your help! :-)
Best,
Christoph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200919/880fefa6/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedImage.png
Type: image/png
Size: 8995 bytes
Desc: pastedImage.png
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200919/880fefa6/attachment-0001.png>
More information about the Squeak-dev
mailing list
|