[comp.sys.mac.programmer] Color Blending Help Needed

jackiw@cs.swarthmore.edu (Nick Jackiw) (03/22/90)

A quick question for those familiar with Color Quickdraw...

If I have an offscreen bitmap with a red rectangle in it, and copyBits
it to a place on the screen on which there is a green rectangle,
so that the two rectangles partially overlap, the srcOr copyMode gives
me a pleasant aesthetic effect: the intersection is appropriately red
or green, and the union is yet a third color--presumably the logical
OR of red and green's RGB values. I *like* this.

How can I configure my cGrafPort (PenMode, etc.) so that if there is
a greenRect onscreen and I do

	ForeColor(redColor);	{or RGBForeColor}
	PaintRect(redRect);

the result is the same--the logical OR of the source (redColor) and the
destination (the screen--partially white, partially green)?

Circumstances prevent me from using an intermediate offscreen bitmap.
I've tried all of the arithmetic modes discussed in IM V, as well as
both patOr and srcOr without seeming to hit upon the answer.  Please
illuminate me!

Thanks...really.




--
-----Nick Jackiw [jackiw@cs.swarthmore.edu|jackiw@swarthmr.bitnet------
"This orbe of starres fixed infinitely vp extendeth hitself in altitvde 
sphericallye, and therefore immovable the pallace of foelicity garnished
with perpetvall shining glorious lightes innvmerable." - Thomas Digges

jackiw@cs.swarthmore.edu (Nick Jackiw) (03/22/90)

I write:
> A quick question for those familiar with Color Quickdraw...
> 
> me a pleasant aesthetic effect: the intersection is appropriately red
> or green, and the union is yet a third color

ARRGH...I mean union-NOT-intersection and INTERSECTION, respectively.

RR                  RR
RR                  RR
RR + GGGGGG       GGxxGG
RR   GGGGGG  =    GGxxGG
RR                  RR
RR                  RR

You get what I mean.  Too much color debugging on a b&w machine...





--
-----Nick Jackiw [jackiw@cs.swarthmore.edu|jackiw@swarthmr.bitnet------
"This orbe of starres fixed infinitely vp extendeth hitself in altitvde 
sphericallye, and therefore immovable the pallace of foelicity garnished
with perpetvall shining glorious lightes innvmerable." - Thomas Digges