VaRGB is a RGB illumination control library that is completely independent of both the type of lighting used and the platform it is run on and is now available as free software.
You tell VaRGB 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.
See it in action, in the video below, and check out the VaRGB project page for all the details.