Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!farrier From: farrier@Apple.COM (Cary Farrier) Newsgroups: comp.sys.apple Subject: Re: Apple IIgs SHR fade Keywords: fade, IIgs, SHR Message-ID: <30927@apple.Apple.COM> Date: 17 May 89 15:33:50 GMT References: <11472@bloom-beacon.MIT.EDU> Distribution: usa Organization: Apple Computer Inc, Cupertino, CA Lines: 34 In article <11472@bloom-beacon.MIT.EDU> mhamaoka@athena.mit.edu (Michael T Hamaoka) writes: > [stuff about fading a SHR screen deleted] You should probably get access to the Apple IIGS Hardware Reference (This one *is* published by Addison Wesley, ISBN 0-201-17743-9), and start reading on page 84, Super Hi-Res graphics. It will tell you all you need to know about how SHR mode operates. About the fading, try this algorithm to fade to black: for(loop = 0 to 15) { for (each color entry in the palette) { if(red_value - 1 > 0 ) decrement the red value; if(green_value - 1 > 0 ) decrement the green value; if(blue_value - 1 > 0 ) decrement the blue value; } } This loop will decrement the RGB values of each color register to zero, thus fading to black. This is not the best algorithm, a better one would be one that would examine all the entries in the color palette and then figure out the amount to decrement each to produce an even fade simultaneously. To fade in, simply reverse the process, incrementing each RGB gun until it reaches it's maximum value for the color desired. Cary Farrier