[squeak-dev] Form - fill area with a TranslucentColor

Bert Freudenberg bert at freudenbergs.de
Wed Sep 28 16:59:30 UTC 2011


On 27.09.2011, at 22:14, Jonathan Mullins wrote:

> Hi all,
> 
> I'm trying to fill areas on a Form object with different TranslucentColors using Form fill:fillColor:, however the areas always get filled with solid colours, ignoring the alpha values altogether. I've tried the different fill modes with no success. The form is initialised with a 32 bit depth. Any ideas?
> 
> I'm using Squeak 2.8 (I think… it's the MIT Scratch image).

This should work:

	Display fill: (0 at 0 corner: 200 at 200) rule: Form blend fillColor: (Color red alpha: 0.5) 

(assuming your Display is 32 bits). See BitBlt class>>alphaBlendDemo for other display depths.

Additionally, there is rule 34 for blending with pre-multiplied alpha, if you want to get serious.

- Bert -


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20110928/5cd96726/attachment.htm


More information about the Squeak-dev mailing list