Palette Cycling
- Posted by Andrew Sharp <asharp at CHILLI.NET.AU> Jan 01, 1999
- 479 views
I'm trying to write a proc for cycling the palette ie:- color255 becomes color254, 254 becomes 253, 253-252 etc right down to color 1 which will become the original color that 255 was, leaving color0 black. The following is getting there but it's way to slow. Each set of 255 takes over 3secs. I'd like the whole palette changed about 10 times per sec. Has anyone got any ideas about how to speed it up? ***************************************************** procedure cycle() sequence paltemp, newpalc paltemp = {0,0,0} while 1 do if get_key() != -1 then exit end if for c = 255 to 1 by -1 do newpalc = palette(c, paltemp) paltemp = newpalc end for end while end procedure *****************************************************