state machine for brightness fading