[ENH] Bob's World Gradient (was: Re: Code Challenge !!!)

Doug Way dway at mat.net
Sat Mar 25 00:23:39 UTC 2000


On Fri, 24 Mar 2000, Bert Freudenberg wrote:

> Any objections to abandoning GradientMorph which saves us 4 (four!)
> instance variables in the World?

No objections here.  Nuke it.  Using GradientFillStyle instead seems like
the right thing to do.  (Unless I'm missing something big here.)

I guess someone needs to actually do this and post the changeset... I'd
say go for it if you were about to do this.

(Hmm, I just noticed that GradientFillMorph/Style doesn't do halftoning
anymore in 2.8a... that's probably in the middle of Andreas' changes.  
Anyway, I don't think it's really related to the above issue.)

> And while we are at it, how about requiring that color is indeed a
> Color? It's extremely ugly to always need to test. With the new
> BitmapFillStyle there's no reason for the InfiniteForm hack anymore
> ... For example, the tranclucency checks become much easier (they're
> still buggy - check dragging a RectMorph with a gradient fill whose
> second color is transparent ...).

Sounds good to me, I think.  (Haven't thought about this too hard.)  
Another changeset? :-)

One thing that I've thought would be handy would be some sort of simple
HalftoneFillStyle.  This would mostly only be useful if you were in 8-bit
screen depth mode, but that is the default mode after all.  You would
specify a color, and it would generate the closest 2x2 halftone
available... the results are very nice if you stick to
checkerboard-pattern halftones, especially... you usually can't even see
the pattern.

For example, the "Pastel" selections in the Window Colors dialog don't
really work currently in 8-bit mode, but you could implement these as 2x2
halftones pretty easily.  I don't think performance would be hurt by much,
since the bottle neck is usually moving bits around anyway.  (Or is there
a better way to do this with an existing FillStyle?  Doesn't BitBlt have
some sort of built-in support for halftoning?)

Maybe I'll try to work on this at some point.  Hmm, now where in the
FillStyle hierarchy would HalftoneFillStyle be most appropriate...

- Doug Way
  EAI/Transom Technologies, Ann Arbor, MI
  http://www.transom.com
  dway at mat.net, @eai.com





More information about the Squeak-dev mailing list