VaRGB is an open source (LGPLed) RGB illumination programming library. You tell it how you want your lighting to behave, and it handles all the details of updating red/green/blue values at the right time for you.
VaRGB: * runs on pretty much anything (AVR, Arduino, PIC, desktops, Raspberry Pi… anything that works with C++); * can be used with any RGB lighting hardware; * is easy to start using but flexible enough to handle all kinds of situations and behaviour.
Much more info is available on the project's home: http://flyingcarsandstuff.com/projects/vargb/
Enjoy