Dan Ingalls wrote:
Here's one approach... | f | f _ (ColorForm mappingWhiteToTransparentFrom: (Form dotOfSize: 50)) colors: (Array with: Color transparent with: Color blue). f displayOn: Display at: 200@200 rule: Form paint
This should display properly in every color depth, but you need the "paint" combination rule which treats transparency correctly.
- Dan
This works with the exception of the offset value which gets set in dotOfSize: ( a class method of Form).
The class methods for instance creation of Forms seems to be incomplete or maybe immature. I don't know the history of the methods or how they evolved, but I found the comment in the instance selector, center (the subject of this post) intriguing.
My proposal is to embrace offset in Form and its decendants. I think that there should be a private instance method like setExtent:depth: which also sets the instance variables offset and bits to appropriate initial values (offset _ 0@0. bits _ ????).
This new method would then cascade down to the various other instance creation methods. There are currently only four users of setExtent:depth:. They are all in Form or ColorForm.
I am willing to make the changes if they are the right thing to do. Otherwise I will go back to contemplating Squeaks navel.
Thanks,
John-Reed Maffeo
squeak-dev@lists.squeakfoundation.org