Gold fish do not technically turn white, but lose color pigmentation when not exposed to enough natural sunlight. The cells responsible for maintaining the bright coloring of goldfish respond to light levels. Fish kept indoors in dark environments fade in color over time because their pigment cells are no longer chemically reacting to bright light.
Goldfish are known for their many shades of bright orange coloring. Some goldfish are speckled with other colors. In their natural habitat, they are constantly exposed to healthy doses of natural light. Sunlight interacts with the body chemistry of the goldfish to bring out their bright coloring.
Placing indoor goldfish in a fish tank, with artificial lighting that mimics the rays of the sun, helps them keep their golden color.