Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!apple!lsr From: lsr@Apple.COM (Larry Rosenstein) Newsgroups: comp.sys.mac.programmer Subject: Re: Access to hardware framebuffer (Color QD) Message-ID: <9880@goofy.Apple.COM> Date: 22 Aug 90 02:42:55 GMT References: <1990Aug21.182827.19315@nada.kth.se> Distribution: comp Organization: Apple Computer, Inc. Lines: 31 In article <1990Aug21.182827.19315@nada.kth.se> d88-jwa@dront.nada.kth.se (Jon W{tte) writes: > >Actually, that is "set the ports RGBFgColor to the value of X" >fgColor is old-style color, with only 8 predefined colors available. I originally thought so too. But a color GrafPort also has a fgColor field, which might be a cache of the index of the foreground color. (It may even be at the same offset as fgColor in an old port, I didn't check.) > >On a 24bit deep screen, this will work: > > RGBForeColor(&colors[index]); I doubt that you'd want to have an array of all 16 million colors. Don't you just take the low order 3 bytes of index and transfer them to the high-order bytes of the red, green, & blue fields of the RGBColor? I'm not sure how you would get QuickDraw to set the high-order byte. >You want to XOR into video index memory !? You'll have to blast the >bits yourself. This gets VERY complicated VERY fast (like, don't forget Actually you can use patXOR mode with color, provide you remember that QuickDraw uses the pen patterns in the transfer mode. -- Larry Rosenstein, Object Specialist Apple Computer, Inc. 20525 Mariani Ave, MS 46-B Cupertino, CA 95014 AppleLink:Rosenstein1 domain:lsr@Apple.COM UUCP:{sun,voder,nsc,decwrl}!apple!lsr