Fish change colors for many different reasons.
First, before I go into that I would like to say that Shawnie is absolutely correct. The nitrogen cycle is something that you should read up on and realize that it is
NOT good for any fish to suffer through the chemical levels of a cycling tank.
Color changes can be due to dietary issues such as too much or too little of something.
Color changes can be due to stress (which is what I would guess your fish's problem was.)
Color changes can be due to times of the day/level of activity. (Example: A nocturnal fish is going to, usually, be colored differently during the day versus when it is most active (at night).
Color changes can be due to many many other factors, including, but not limited to sexual maturity or lack thereof, whether or not the fish is mating or preparing to start mating rituals, the fish's mood (anger, defense, calm, etc), and many other factors I care not to take up the site's entire forumspace listing.
Hope that makes sense and helps, but again, Shawnie's advice on nitrogen cycle is the important advice of this thread. (Because, honestly, color matters a lot less than living versus dead.

)