The main function of anthocyanins is to provide colour, in flowers, leaves, stems and fruit. (Incidently, Alisdair, the most common anthocyanin, cyanidin, was first isolated from your favourite Cornflowers (Centaurea cyanus)). They also have a secondary function and that is to provide protection against tissue damage caused by the effects of ultraviolet radiation. Along with other flavonoids and carotenoids they absorb UV wavelengths. Maybe increased stress levels due to high exposure to UV triggers a response reaction and anthocyanin production is increased as a protective measure.