In the 70s and 80s many gay men used to advertise their various kinks through the handkerchief code. By wearing colour coded bandannas in the back pocket of their jeans they could let others know what turned them on.
In its early manifestation the code of a dozen or so colours was manageable. But after a while yellow for water sports or red for fisting wasn’t specific enough for some tastes.
Andrejkomasky lists over 80 variations but please don’t confuse your fuschias with your magentas unless you’re particularly into spanking armpits…..
There’s also a fine (nonsexual) history of the handkerchief over here
In the 18th and 19th centuries, handkerchiefs were used mostly by men. Many feature common male interests, such as grand industrial projects; sport (horse racing, pigeon shooting, cricket and boxing); railways; mapping; and, especially during the Napoleonic wars, the great naval and military encounters of the day.
Another stylee is the handkerchief joke that folds to produce a punchline. One illustrates the “Eastern Question” (the conflict with Russia over the Ottoman empire). It shows portraits of four of the chief rivals: a Russian hero of the Crimean war, Prince Gorschakoff; Germany’s chancellor Otto von Bismarck; and the Turkish foreign minister, Safvet Pacha. If folded across the diagonals, the portraits morph into a single head-that of Benjamin Disraeli, the British prime minister, who lorded over them all