Why the female peacock have colorful feathers like male?

The premise of your question is not accurate. Female peacocks, also known as peahens, do not have colorful feathers like male peacocks, called peacocks. Male peacocks have elaborate and vibrant plumage, particularly their long tail feathers, which they display during courtship rituals to attract females. In contrast, female peacocks have duller and less colorful feathers, primarily brown or grey, which serve as natural camouflage to protect them during nesting and raising their young.