The purpose of a peacock's colorful feathers is primarily for attracting a mate during the mating season. The vibrant and iridescent feathers are used by male peacocks in elaborate courtship displays to impress and win over peahens. The brighter and more colorful the feathers, the more likely the peacock is to attract a mate.