Squeak color question and comment...

Maloney johnm at wdi.disney.com
Mon Jan 5 17:29:11 UTC 1998


>I'm playing with some of the code from "A Taste of Smalltalk" and have a
>comment and question.
>First off it seems that Squeak doesn't implement the white: black: gray:
>etc. rectangle filling methods.
>I've gotten around this by just calling fillWhite:, etc from the
>DisplayMedium class.  If anyone wants to
>pass on the actual definitions of white:, etc. I'd appreciate it.
>
>My question is why does 'invert'ing a white display (on the Windows version
>of Squeak) produce pink?
>I haven't looked into this yet, figured I'd ask if anyone knows...I was sort
>of expecting black.
>
>Cheers,
>S

That protocol has changed with the advent of color.
Try "fill:fillColor:" as in:

    Display fill: (0 at 0 extent: 10 at 10) fillColor: Color white

Inverting does a bit-invert on each pixel value. In 8-bit color, the
bit patterns for white and black on not bit-inverses
of each other. If you set your display depth to 1, you'll get
the black/white reversal effects discussed in the book.
 
When you get the code working, could you send it to us? It would be
great to include an updated version of this example in an online-tutorial
that follows "A Taste of Smalltalk"!

	-- John





More information about the Squeak-dev mailing list