Moved the rgb calculation out of hte light loop