Anthocyanin production, possibly to help protect from ultraviolet light damage, or to make the acorn less obvious to predators.
Thank you Michael ! Wikipedia says that Anthocyanin changes also the taste of the plant to something more bitter so the animals do not eat it.
Not sure that is right, anthocyanins are now known to have important health benefits in the human diet, and are commonly eaten (e.g. beetroot, blackberries, red cabbage, red wine, etc.).