The way in which a complex trait varies, and thus evolves, is critically affected by the independence, or modularity, of its subunits. How modular designs facilitate phenotypic diversification is well studied in nonornamental (e.g., cichlid jaws), but not ornamental traits. Diverse feather colors in birds are produced by light absorption by pigments and/or light scattering by nanostructures. Such structural colors are deterministically related to the nanostructures that produce them and are therefore excellent systems to study modularity and diversity of ornamental traits. Elucidating if and how these nanostructures facilitate color diversity relies on understanding how nanostructural traits covary, and how these traits map to color. Both of these remain unknown in an evolutionary context. Most dabbling ducks (Anatidae) have a conspicuous wing patch with iridescent color caused by a two-dimensional photonic crystal of small (100-200 nm) melanosomes. Here, we ask how this complex nanostructure affects modularity of color attributes. Using a combination of electron microscopy, spectrophotometry, and comparative methods, we show that nanostructural complexity causes functional decoupling and enables independent evolution of different color traits. These results demonstrate that color diversity is facilitated by how nanostructures function and may explain why some birds are more color-diverse than others.