A hydrate is a substance that contains water. In inorganic chemistry, it refers to salts or ionic compounds that have molecules of water incorporated into their crystal structure. Some hydrates change color when they are heated.
The chemical formula of a hydrate lists the water molecules after the other elements that form the compound. Copper (II) sulfate pentahydrate, for instance, is CuSO4 * 5H2O. Epsom salt, gypsum and borax are everyday examples of hydrates.
When the hydrate is heated, the water molecules break free of the complexes they have formed with the ions in the crystal lattice. The loss of the water molecules changes the structure of these complexes and hence their properties.
Substances appear to have color when they absorb or reflect specific wavelengths of light. When the hydrate loses the water molecules and the structure of the ion complexes changes, the orbitals available to electrons in the ions also change, so the compound will absorb and reflect different wavelengths or "colors" of light than it did before.