Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!ncar!elroy.jpl.nasa.gov!sdd.hp.com!hp-pcd!hplsla!tomb From: tomb@hplsla.HP.COM (Tom Bruhns) Newsgroups: comp.sys.amiga.graphics Subject: Re: 4096 in a row Message-ID: <18310001@hplsla.HP.COM> Date: 21 Mar 91 16:56:40 GMT References: Organization: HP Lake Stevens, WA Lines: 29 swildner@channelz.gun.de (Sascha Wildner) writes: >Is there any way to get those 4096 colors of the Amiga in a row so that the >difference between color[n] and color[n+1] is only one modification of either >R, G or B? The explanation did not make it absolutely clear: is a transition in a given color allowed to be more than one level at a time (in what you want)? If so, one answer to your question is to gray-code the 12 bits; in gray (or maybe Gray ;-) code, only one bit changes each step, all the way around a circle till you get back where you started. I believe this also would be allowed in HAM (though I have to admit I'm only marginally familiar with HAM's limitations). You should be able to find documentation on Gray code in any library with a techinical section. e.g.: Bin Gray Bin Gray 0000 0000 1000 1100 0001 0001 1001 1101 0010 0011 1010 1111 0011 0010 1011 1110 0100 0110 1100 1010 0101 0111 1101 1011 0110 0101 1110 1001 0111 0100 1111 1000 A symmetry should be apparent in the Gray code. You can generate Gray code from straight binary through appropriate XOR op's, I believe. Gray is used for things like optical encoders to insure that transitions from one word to the next don't generate outputs that appear to come from a "long ways away".