The blue colours of the speculum of the mallard (Anas platyrhynchos), both male and female, and the green head feathers of the male arise from light interacting with stacks of melanosomes residing in the feather barbules. Here, we show that the iridescent colours can be quantitatively explained with an optical multilayer model by using a position-dependent effective refractive index, which results from the varying ratio of melanin and keratin. Reflectance spectra obtained by multilayer modelling and three-dimensional finite-difference time-domain calculations were virtually identical. The spectral properties of the barbules' photonic structures are sensitive to variations in the multilayer period and the cortex thickness, but they are surprisingly robust to variations in the spatial parameters of the barbules' melanosome stacks. The blue and green reflectance spectra of the structural-coloured feathers correspond with the sensitivity spectra of the short- and middle-wavelength-sensitive photoreceptors, indicating their biological significance for intraspecific signalling.