Food science, ingredient Technology and packaging are used to isolate metal ions in food to avoid off colors.
There are many factors which food turn the the dye of food color into hazy shades. For this the metal present in the food should be isolated. Before isolating we should have proper knowledge of the metal by having tests.
Once the metal is detected by the chemical reaction, it should be isolated by using techniques regarding isolation of ingredients. Also the color mixed in the food should be according to the FDA rules and regulations. Common example of colors of foods are red yellow blue Green etc.