Purple dye originally came from the mucus glands of a snail. The discovery of the dye is often attributed to the mythological Greek God; Heracles, or rather his dog, who was eating snails off the coast of the Levant and returned with a mouth stained a deep purple colour. From a biological point of view the snails use the purple mucus as a defence mechanism to spray predators and make their escape, they also use it to catch their own prey and protect their eggs.
The colour purple was incredibly rare at the time, it is unlikely that those who discovered the snails had ever seen another purple plant, animal or living thing, as such the colour was vastly sought after. However it was a very slow and costly process to create dye from the mucus produced from the snail, it required over 12,000 of the shellfish to extract just 1.5 grams of the dye, enough to colour a handkerchief. Purple quickly became incredibly valuable and even worth more than gold, by 300 BC a pound of purple dye was worth 3 times a bakers annual wage.
Purple became the colour of kings, nobles, priests and magistrates all around the Mediterranean. Alexander the Great was noted as wearing purple when he gave his addresses and it became particularly popular during the Roman empire where it was exclusively associated with the Emperors and their officers. The Emperor Caligula had the King of Mauritania murdered for wearing a purple mantle he thought was better than his own, and the Emperor Nero made it punishable by death for anyone else to wear the colour.
Purple remained the colour of aristocracy and prestige for centuries until it was accidentally synthesised by William Henry Perkin in 1856. Perkin was studying at the Royal College of Chemistry in London where he was tasked with finding a way to synthesise quinine, which is a rare natural substance essential for the treatment of malaria. Perkin underwent series of experiments to discover quinine, during this he managed to create a substance with an intense purple colour. Perkin had a keen interest in painting and photography and was very enthusiastic about his discovery, he found that the purple substance dyed silk in a way which was stable when washed or exposed to light. He had managed to create the first synthetic dye, he filed a patent for the dye when he was only 18 years old and began to set up his own business.
Perkin called his discovery mauveine, and for the first time in the history of the world purple dye was finally widely available to the public.