Added the ability to change the period of the fade, leaving a smooth transition.