The joke is a play on words.  The word 'pigment' means a color, and sounds like 'figment' which in the phrase 'figment of your imagination' means it is an illusion made by one's own mind.
When you dream in color , it ' s a pigment of your imagination .