Dear Student
Plants have variously colored flowers to attract insects and other animals for pollination. Colored flowers attract diurnal insects such as honeybees. White flowers attract nocturnal insects like moths. Also flowers are meant for sexual reproduction.
Regards