This sketch shows how to fade a RGB led using the analogWrite() function and a sampling of the color.