Emission or absorption of light having a specified wavelength is responsible for a color's existence. The process of absorption of energy by a chemical generates an electron's excitation which leads to the presence of colors, as a physical property of a chemical. Usually, the color of a chemical represents the result of replacing the absorbed wavelength by the chemical.
The different amounts of energies possessed by the electrons of an atom are proportional to the distance between the nucleus of the atom and the orbital location of electrons. The more closer to the nucleus an electron is, the lower the potential energy it possesses. For an electron to pass from one level to the next one, it must absorb energy, which is usually provided by light. One electron will absorb one photon and the color of the chemical is influenced by the amount and frequency of photons absorbed.
Hence, the lower the frequency of an absorbed photon, the redder the color of the chemical, while the higher the frequency of a photon is, the more blue the color of the chemical becomes.