The colour of an ionic compound is often different from the colour of an aqueous solution containing the constituent ions, or the hydrated form of the same compound.
The anions in compounds with bonds with the most ionic character tend to be colorless (with an absorption band in the ultraviolet part of the spectrum). In compounds with less ionic character, their color deepens through yellow, orange, red, and black (as the absorption band shifts to longer wavelengths into the visible spectrum). 
The absorption band of simple cations shifts toward a shorter wavelength when they are involved in more covalent interactions. This occurs during hydration of metal ions, so colorless anhydrous ionic compounds with an anion absorbing in the infrared can become colorful in solution.
Salts exist in many different colors, which arise either from their constituent anions, cations or solvates. For example:
* sodium chromate  is made yellow by the chromate ion .
* potassium dichromate  is made red-orange by the dichromate ion .
* cobalt(II) nitrate hexahydrate  is made red by the chromophore of hydrated cobalt(II) .
* copper(II) sulfate pentahydrate  is made blue by the hydrated copper(II) cation.
* potassium permanganate  is made violet by the permanganate anion .
* nickel(II) chloride hexahydrate  is made green by the hydrated nickel(II) chloride .
* sodium chloride NaCl and magnesium sulfate heptahydrate  are colorless or white because the constituent cations and anions do not absorb light in the part of the spectrum that is visible to humans. 
Some minerals are salts, some of which are soluble in water. Similarly, inorganic pigments tend not to be salts, because insolubility is required for fastness. Some organic dyes are salts, but they are virtually insoluble in water.