William Perkin was young and still a student when he made his famous discovery. When he was 12, a friend showed him some chemical experiments that produced beautiful crystals. Perkin was so impressed that he started accumulating different kinds of chemicals, and later devised some experiments.
During his time, chemistry was not a required subjects. However, he had the opportunity to sit in Mr. Thomas Hell's chemistry class held at lunchtime. He sometimes missed his lunch just to attend the lecture. His enthusiasm was rewarded when he was asked to be the helper in Mr. Hell's lecture demonstrations. This eventually led to his enrollment in the Royal Collage of Science at age 15. He became an assistant of the great German chemist August Willhelm Von Hofmann, who encouraged him to prepare quinine (a medicine for malaria) by oxidation of some organic nitrogen compounds.
One vacation time, Perkin got anilinium bisulfate (a nitrogen compound) and oxidized it with potassium dichromate. The result was a black tarry solid rather than a white crystalline quinine. Surprised at what he found, he extracted it with hot water and the solution produced crystals of bright purple color.
He discovered something he did not expect. He thought it was a dye and tried it on silk and cotton. it dyed the silk but not the cotton. More experiments led to the discovery of another substances called "mordant" that could make the dye stick to cotton. Such discovery led to our present day synthetic dye industry.