Smooth transition between RGB colors in JavaScript