The major reason why fish may lose colour is due to stress. This stress is usually due to a change in environment including variations in water temperature, a change in water pH, and other factors. You may find out that if you buy your fish looking bright and glossy from one aquarist and introduce them to a new tank, they may initially lose colour. Their colour may be regained after getting used to, or getting comfortable with, the new environment.
It is important to check if they are suffering from other diseases or illnesses that may be contributing to the loss of colour. Fish may experience colour loss due to a decline in sunlight that they were accustomed to receiving under normal conditions. To remedy to this, try to place your aquarium at a place where your fish continues to receive just enough sunshine, or use a UVB light source. You can better understand this concept by comparing it to how people from cooler places have lighter skin colour than those from hotter places.
However some colour loss can be caused by stress from some factors that you can easily and immediately control. Once you see that your fish are losing colour, check your water chemical levels and correct them. Also check that the fish are eating and behaving well; their fins are erect and white. If you notice that their eating and behaviour habits are not normal, you need to contact a veterinarian or specialist of fish health issues.
To prevent your fish losing colour, the best thing to do is to try to keep your aquarium environment normal. Too many nitrites or phosphates can cause your fish to lose their colour. Such issues must be checked and regulated once you notice fish discolouration. Frequent water changes can also be helpful to regulate the aquarium environment. Once the normal aquarium environment is restored, the fish should regain their colour.
It is also important to check that your water temperature is not too high or too low. Temperatures that are too high or too low can induce stress on your fish and make them lose colour. If you perform your normal aquarium routines and checks but still find your fish losing colour, then you may need to consult a knowledgeable veterinarian to avoid losing your fish.