I want the LED to, at the press of a button, run through "all the colours of the rainbow", once.

As in, press the button: Red orange yellow green blue Off

I have been trying to understand and chop up the RGB demo code from oomlout:

http://oomlout.com/RGBL/CODE/_RGBL_AnalogTest.txt

but it doesn't like my chopping. And i think the code is probably a bit over complex for my simple purpose.

What approach would the panel suggest for this simple task?

P.S. for my project, i would also like to be able to serial print a linerar representation of the colour value. I guess the easiest way to do this would be to assign the planned colour range an arbitrary value: red is 0, green is 128, blue is 256..this may over complicate matters, it may make it simpler.

Attached is code I did for a similar project using an ATtiny85 but it will easily adapt to normal Arduino by just altering the relevant LED pin numbers to Arduino PWM pins (the ones with a ~ mark by them). This code is designed to work with the equivalent of common cathode LED's but should still work with common anode. Don't forget your resistors.