Answer explained
What is the function of petals in flowers?
Petals are the flower's corolla parts. In many flowers, their colour, scent and shape attract pollinating animals. Markings may also guide visitors toward nectar.
This helps pollen transfer between suitable flowers. Not all flowers require brightly coloured petals.