You're probably better of incrementing a color value 1 at a time in your main loop, then decreasing it again once it's at a certain amount. This will give you a more progressive fade effect that will take longer.