This color is due to the presence of the flavylium cation form, which is the dominant form of anthocyanins at low pH.
Anthocyanins, responsible for red, purple, and blue colors in plants, differ from other pigments like carotenoids and chlorophylls because their color changes with pH, making them unique pH indicators, while other pigments are more stable in color. Anthocyanins are a whole family of plant pigments. They are present in lilac, red, purple, violet or even black flower petals. Anthocyanins are also found in fruits and vegetables, as well as some leaves. Cold weather causes these purple pigments to absorb sunlight more intensely, which, in turn, raises the core temperature of the plant compared to that of the ambient air. This protects the plant from cold temperatures. In hot weather or at high altitudes, anthocyanins protect the plant cells by absorbing excessive ultraviolet radiation. Furthermore, a vivid petal coloration makes it easier for insects to find the flowers and pollinate them. No need to worry, beautiful work.
For anyone interested in anthocyanins, chapter#11 week 16iirc or thereabouts for a book 📖 of info.