Animal colours commonly act as signals for mates or predators. In many damselfly species, both sexes go through a developmental colour change as adults, and females often show colour polymorphism, which may have a function in mate choice, avoidance of mating harassment and camouflage. In the blue-tailed damselfly, Ischnura elegans, young males are bright green and turn blue as they reach maturity. Females are red ( rufescens) or violet ( violacea) as immatures and, when mature, either mimic the blue colour of the males ( androchrome), or acquire an inconspicuous olive-green ( infuscans) or olive-brown ( obsoleta). The genetic basis of these differences is still unknown. Here, we quantify the colour development of all morphs of I. elegans and investigate colour formation by combining anatomical data and reflectance spectra with optical finite-difference time-domain simulations. While the coloration primarily arises from a disordered assembly of nanospheres in the epidermis, morph-dependent changes result from adjustments in the composition of pterin pigments within the nanospheres, and from associated shifts in optical density. Other pigments fine-tune hue and brilliance by absorbing stray light. These mechanisms produce an impressive palette of colours and offer guidance for genetic studies on the evolution of colour polymorphism and visual communication.