updating rgb transition to do mathematical interpolation