The colour comes from the absorption of light across the visible spectrum (absorption spectrum) as a result of induced transitions between the electronic states of the molecule. In organic conjugated molecules, the energies of the states are largely determined by the pi electrons. In organometallic compounds, the energies are also influenced by the metal. Free base porpyrins have a Soret band in the blue (~420nm) and Q bands in the red/near infrared. These absorptions give rise to the purple colour.
Porphyrins are strongly colored compounds. The variety of available colors is apparently unlimited although there is an observable inclination towards red and purple. The color is a consequence of the complicated electronic spectra of porphyrins, which contain intense absorptions in the visible region (called Q bands).
Please check further details via the following link: