How did 黃 (yellow) come to mean "pornographic"?
According to this article, there are four possible explanations as to why yellow colour is associated with pornography. Below is a slightly modified translation of the article based on further references from the internet:


Orpiment (雌黃). Orpiment is a toxic orange-yellow mineral that is used as a
pigment by ancient people. Due to poor bleaching technology, paper
produced in the olden days was slightly yellow. When words on a
paper need to be corrected, orpiment can be used to smear onto the
written words, creating a layer of slightly opaque yellow close to
the paper's colour, enabling a rewrite. Soon, people describe
uttering nonsense as "信口雌黃". Subsequently, the yellow colour of
orpiment and its toxicity is later extended to mean poisoning of the
mind.
The Yellow Union. In 1887, in a city in France, a factory owner tried to prevent his
workers from going on strike by bribing the Yellow Union. The
workers discovered the betrayal and angrily smashed the windows of
the union clubhouse. The union then used yellow paper backings as a
replacement for the windows. Since then, the workers labelled these
union people as "见不得人的黃色工会”, meaning a union that cannot face the
public, similar to pornography.
The Yellow Book. In 1894, a British magazine
named "The Yellow Book", gathered in a group of conservative collection of authors
to produce quarterly literary periodicals that are thought to be scurrilous in content. Later, a
prestigious Irish playwright, Oscar Wilde, was arrested on
homosexuality charges. At the time of his arrest, Oscar was
seen holding a yellow book (which turns out to be a French novel). People misidentified the material to be The Yellow Book and associated it with his personality. The next day people demonstrated in front of the publisher, and a furry of media reports soon cemented an association between yellow paperbacks and homosexual content.
The Yellow Kid. The end of the 19th century New
York, New York World and New York Journal competed for readers
intensely, posting vulgar comics content to which "The Yellow Kid"
is one of them and is the origin for the term "yellow journalism".
Since then, the colour yellow is associated with erotic and vulgar
things.