Mauveine
Mauveine, also known as aniline purple and Perkin's mauve, was the first synthetic organic dye.
Its chemical name is 
3-amino-2,9-dimethyl-5-phenyl-7-(p-tolylamino)phenazinium acetate. The formula is C26H23N4+X (mauveine A) and C27H25N4+X (mauveine B, see below). 

# History
Mauveine was discovered serendipitously in 1856 by an 18-year old, William Henry Perkin, who was trying to synthesize the anti-malaria drug quinine as a challenge offered by his professor, August Wilhelm von Hofmann.  In one of his attempts related to the quinine challenge, Perkin oxidized aniline using potassium dichromate.  Under these conditions, the aniline reacted with toluidine impurities in it to produce a black solid, a fairly common result in "failed" organic syntheses.  However, while trying to clean out his flask, Perkin discovered that some component of the black solid dissolved in alcohol to give a purple-colored solution, which proved to be an effective dye for silk and other textiles.
Perkin patented the new dye and the next year, he opened a dyeworks at Greenford on the banks of the  Grand Union Canal in  London in order to mass produce it. It was originally manufactured under the name of aniline purple or Tyrian purple, also the name of an ancient mollusk-derived natural dye. The name mauve was given to it in England in early 1859, from the French word malva for the mallow flower, and chemists later called it mauveine. Mauve became highly fashionable in 1862 when Queen Victoria of the United Kingdom appeared at the Royal Exhibition in a mauve silk gown.  Mauve fell out of fashion in the late 1860s to newer synthetic colors, but not before making Perkin's fortune and birthing the synthetic chemical industry. The U.S. National Association of Confectioners included mauvein among permitted food colorings as of the early 20th century, with a variety of equivalent names: rosolan, violet paste, chrome violet, anilin violet, anilin purple, Perkins violet, indisin, phenamin, purpurin, tyralin, Tyrian purple, and lydin. Later work on chemical dyes also led to the (accidental) development of modern chemotherapy (see Sulfonamide).
The color of this dye may be familiar from its widespread use in spirit duplicator (trade name Ditto) printing machines, popular during the mid-20th century.

# Chemical analysis
A modern-day laboratory procedure for the organic synthesis of mauveine consists of dissolving a mixture of aniline, p-toluidine and o-toluidine in sulfuric acid and water (large excess poor solubility) in roughly a 1:1:2 ratio followed by addition of potassium dichromate .    
The actual molecular structure of mauveine proved quite difficult to determine and was not known with certainty until 1994.
- skeletal formula of mauveine A
skeletal formula of mauveine A
- skeletal formula of mauveine B
skeletal formula of mauveine B
- skeletal formula of mauveine B2
skeletal formula of mauveine B2
- skeletal formula of mauveine C
skeletal formula of mauveine C
It is actually a mixture of four related aromatic compounds, which differ only in the number and placement of methyl groups. A is built up from 2 molecules of aniline, one of p-toluidine and one of o-toluidine whereas B incorporates aniline, p-toluidine and o-toluidine one molecule each. As Perkin showed in 1879, mauveine B is related to the safranines  by oxidative/reductive loss of the p-tolyl group. In fact, safranine itself is a 2,8-dimethyl phenazinium salt, whereas the  parasafranine produced by Perkin must be presumed to be the 1,8-(or 2,9) dimethyl isomer.
In 2007 two other mauveine components were isolated and identified, called mauveine C (an additional p-methyl group on mauveine A) and mauveine B2 (an isomer of mauveine B with methyl on different aryl group).