Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!claris!UUCP!peirce From: peirce@outpost.UUCP (Michael Peirce) Newsgroups: comp.sys.mac.programmer Subject: Re: HOWTO: Gray things in color Message-ID: <0B01FFFB.ge4vgr@outpost.UUCP> Date: 24 May 91 16:09:11 GMT Reply-To: peirce@outpost.UUCP (Michael Peirce) Organization: Peirce Software Lines: 53 X-Mailer: uAccess - Mac Release: 1.1.b3 In article <1CE00001.geic0m@tbomb.ice.com>, time@ice.com (Tim Endres) writes: > > This seems like a really stupid question, but I see no reference to > it in my docs. I've have heard say that the way to get the nice smooth > dimming in color is to "blend a 50% gray RGB". > > Anybody got a ready handy snippet to gray an icon or text? Here are some snippets from some code I did to play with this type of thing: VAR blendWeight : RGBColor; foreColor : RGBColor; ... { % this blends in whiteI } WITH foreColor DO BEGIN red := 65535; blue := 65535; green := 65535; END; WITH blendWeight DO BEGIN red := 32768; blue := 32768; green := 32768; END; { %Jblends in black } WITH foreColor DO BEGIN red := 0; blue := 0; green := 0; END; WITH blendWeight DO BEGIN red := 28672; blue := 28672; green := 28672; END; PenMode(blend); OpColor(blendWeight); RGBForeColor(foreColor); PaintRgn(theRgnToTint); PenMode(patCopy); -- Michael Peirce -- outpost!peirce@claris.com -- Peirce Software -- Suite 301, 719 Hibiscus Place -- Macintosh Programming -- San Jose, California 95117 -- & Consulting -- (408) 244-6554, AppleLink: PEIRCE