Many lichens produce secondary compounds, including pigments that reduce harmful amounts of sunlight and powerful toxins that deter herbivores or kill bacteria. These compounds are very useful for lichen identification, and have had economic importance as dyes such as cudbear or primitive antibiotics.
A pH indicator (which can indicate acidic or basic substances) called litmus is a dye extracted from the lichen Roccella tinctoria ("dyer's weed") by boiling.  It gives its name to the well-known litmus test.
Traditional dyes of the Scottish Highlands for Harris tweed and other traditional cloths were made from lichens, including the orange Xanthoria parietina ("common orange lichen") and the grey foliaceous Parmelia saxatilis common on rocks and known colloquially as "crottle".
There are reports dating almost 2,000 years old of lichens being used to make purple and red dyes. Of great historical and commercial significance are lichens belonging to the family Roccellaceae, commonly called orchella weed or orchil. Orcein and other lichen dyes have largely been replaced by synthetic versions.