We report the mechanism of color production in peacock feathers. We find that the cortex in differently colored barbules, which contains a 2D photonic-crystal structure, is responsible for coloration. Simulations reveal that the photonic-crystal structure possesses a partial photonic bandgap along the direction normal to the cortex surface, for frequencies within which light is strongly reflected. Coloration strategies in peacock feathers are very ingenious and simple: controlling the lattice constant and the number of periods in the photonic-crystal structure. Varying the lattice constant produces diversified colors. The reduction of the number of periods brings additional colors, causing mixed coloration.