Using prime numbers to step through a table insures that every position of the table will be selected, using three different prime numbers gives (in this case, 256) different combinations. You might want to use larger prime numbers and add each to a 16 bit value, using the resulting high order bits as the color value. Sounds like a fun thing to [lay with. Bill ----- Original Message ----- From: "Sergio Masci" To: "Microcontroller discussion list - Public." Sent: Thursday, February 03, 2005 10:18 AM Subject: Re: [PIC:] RGB Color mixing or randomization > Hi Michael, > > You might like to try: > > while true do > red = red + 11 > green = green + 13 > blue = blue + 17 > display(red, green, blue) > done > > where red, green and blue are defined as 8 bit ints and each is the brightness > for that colour, 0 being off, 127 being half brightness, 255 being full > brightness etc > > > Regards > Sergio Masci > > http://www.xcprod.com/titan/XCSB - optimising PIC compiler > FREE for personal non-commercial use > > > > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist