Colour Changes with Caffeine

text: "Colour Change with Caffeine" preview image. images included: raspberries, brambles, hydrangea, vials of extract and molecular structure of caffeine

Co-Authored by Iain A. Smellie*, Alexandra G. Armitage*, Iain L. J. Patterson*, Renald Schaub*

*University of St Andrews, School of Chemistry, North Haugh, St Andrews KY16 9ST, United Kingdom

Over the last 3 years, we have been interested in the rich variety of colours observed when anthocyanins-containing aqueous plant extracts are exposed to acids,1 bases,1 bisulfite ions2,3 and certain metal ions.2,4 All of our experiments have been designed to use materials that are readily sourced and can be conducted at home. In 2020, Tom Kuntzelman highlighted a very interesting observation related to the colours of blueberry-derived dyes.5 The article noted that the red colour of the juice from frozen blueberries changed to violet-blue when tap water was added. In that case, there was no significant pH change, however it was noted that certain dissolved metal ions could potentially affect a colour change in anthocyanin solutions (Al3+, Fe3+ or Cu2+).

A range of molecular interactions, including binding to metal ions,6 can change the colour of anthocyanin solutions by a process known as “copigmentation”.7,8 A recent comprehensive review7 of copigmentation in anthocyanins offers the following useful definitions:

  1. “The formation (in the presence or absence of metal ions) of non-covalent complexes involving an anthocyanin or anthocyanin-derived pigment on the one hand and a copigment on the other.”
  2. “Subsequent changes in optical properties of the pigment.”

Complexation by metal ions (Figure 1, Structure A) can position anthocyanin rings so that they overlap (Figure 1, Structure B), and the corresponding solutions may shift from being red-violet, to blue-violet colours.

Figure 1: Binding interactions between metal ions and anthocyanins (R = sugar units)


Complexation of aluminium ions with delphinidin is believed to be responsible for the colour changes observed in hydrangea flowers.9,10 It has been proposed that blue hydrangea flowers contain the aluminium complex shown in Figure 2. In this structure, the anthocyanin ring is close enough to align with the aromatic ring of the ester side chain.10


Figure 2: The Al3+ complex bound to delphinidin that has been proposed to be present in blue hydrangea sepals.


It is also possible for anthocyanin molecules to associate in solution by a non-covalent process often referred to as “π-stacking”.7,8 This involves the planar aromatic regions of anthocyanins arranging parallel to each other as shown in Figure 3 (Arrangement A). Alternatively, anthocyanins can arrange parallel to other similar molecules, Figure 3 (Arrangement B) showing a flavone molecule in a stacking interaction with an anthocyanin. The previously reported blueberry juice colour changes,5 were likely due to variations in the association of anthocyanin molecules with each other (or other similar molecules) in aqueous solution.


Figure 3: π stacking arrangements of anthocyanin ring structures (Arrangement A) and an anthocyanin with a flavone (Arrangement B).


Other planar aromatic molecules are also known to engage in π-stacking interactions with anthocyanins. For example, caffeine has previously been studied as a copigment with purified samples of anthocyanins11 and fruit tea12. In this article, we highlight some simple experiments where anthocyanin-containing fruit extracts are mixed with aqueous solutions of caffeine. The objective of this work was to investigate whether aqueous anthocyanin solutions from fresh fruit extracts can change colour in the presence of caffeine.


Experiments with raspberries and wild blackberries “brambles”

Experiments were conducted with commercially sourced raspberries (Rubus idaeus) and foraged wild blackberries (Rubus fruticosus known in the UK as “brambles”). Frozen raspberries or brambles were soaked in hot water and mashed to release as much juice as possible. Samples of the resulting fruit extract were then filtered to remove the fruit pulp. The filtered extracts were then diluted with an aqueous solution of caffeine (2% w/w).  


Results from raspberry extract

Raspberry extract was diluted with water and compared with a sample of extract diluted with 2% caffeine solution. The raspberry extract was pale red-pink, in contrast, the extract mixed with caffeine solution appeared violet in colour (Figure 4). Caffeine is a weak base, so the pH of each solution was examined before and after addition of caffeine solution. The raspberry extracts were found to be pH 3-4, the extract mixed with caffeine raised the pH to ~5-6. To control the pH of the extracts, additional raspberry samples were mixed with aqueous hydrochloric acid. One of the acidified samples was diluted with water, a second acidified sample was mixed with 2% aqueous caffeine. As expected, the raspberry extract was pale red due to the formation of the flavylium ion form of the anthocyanins present in the solution (Equation 1).8 However, the extract mixed with caffeine solution appeared to be violet-pink in colour (Figure 4). 

Figure 4: Experiments with raspberry extracts. A = raspberry extract with HCl, B = raspberry extract with HCl mixed in 2% caffeine solution, C = raspberry extract, D = raspberry extract mixed in 2% caffeine solution.


Possible explanations for the raspberry extract experiment results

Anthocyanins in acidic conditions (pH < 4) largely exist as flavylium ions (Equation 1),1,8 the resulting aqueous solutions are often red in colour. If the colour changes observed were solely due to a pH change, the extract in caffeine solution (pH 5) would be expected to become colourless. This is because the colourless hemiketal form is the dominant anthocyanin species between pH 5 and pH 6 (Equation 1).1,8


Equation 1: pH controlled flavylium ion/hemiketal adduct equilibrium of anthocyanins


To allow comparisons to be made, a series of buffer solutions were prepared and mixed with raspberry extract. The colour of the extract solutions over the pH range shown (see Figure 5) was then compared with the extract mixed with caffeine. As predicted, raspberry extract mixed with pH 5 or pH 6 buffer solution was colourless rather than the violet-pink colour observed in the presence of caffeine (see Figure 4, solution D). This observation suggests the colour change observed when the raspberry extract was dissolved in 2% caffeine is not a simple pH response. Rather, it can likely be explained in terms of a copigmentation interaction between anthocyanins and caffeine.11,12


Figure 5: Raspberry extracts mixed with buffer solutions (pH 1 – pH 7)


Some evidence for a copigmentation effect comes from the observation that acidified solutions of extract also showed colour differences when samples with and without dissolved caffeine were compared. The sample containing caffeine appeared violet-pink at pH 1, rather than the red coloured solution obtained in the absence of caffeine at the same pH. These observations have precedent in the literature, UV-visible spectra of acidified solutions of anthocyanin extracts show a shift of the absorption maximum to longer wavelengths when dissolved caffeine is present.11,12 If the absorption maximum is shifted as reported, red solutions would be expected to become more violet in colour in the presence of caffeine. UV-visible spectra of the raspberry extract solutions shown in Figure 4 have been recorded and are provided in the supporting information document.    

UV-visible spectroscopy and Nuclear Magnetic Resonance (NMR) spectroscopy experiments, (in conjunction with computational studies) have been used to investigate the copigmentation interaction of rutin (a flavone) with caffeine.13 These experimental findings may suggest that analogous interactions of a caffeine with the anthocyanins in raspberry extract adopt assemblies similar to those shown in Figure 6.


Figure 6: Possible π stacking arrangements of anthocyanin ring structures with molecules of caffeine.


Results from bramble extract

Bramble samples were subjected to the same set of experiments as raspberry extracts. The bramble extracts were diluted with water and compared with a sample of extract diluted with 2% caffeine solution. The pH response of bramble extract had a similar pH to raspberry extract. Likewise, the pH of the extract was found to increase to pH 7-8 when dissolved caffeine was present. A similar outcome was observed for the colour of each of the 2 samples, the bramble extract was pale red and the extract mixed with caffeine solution appeared violet in colour (Figure 7). Acidified solutions were also examined, two bramble samples were mixed with aqueous hydrochloric acid. One of the acidified samples was diluted with water, the second acidified sample was mixed with 2% aqueous caffeine. The acidified samples behaved in a similar way to the raspberry extracts. The bramble solution was red and the extract mixed with caffeine solution appeared to a vivid violet-pink colour (Figure 7).


Figure 7: Experiments with bramble extracts. A = bramble extract with HCl, B = bramble extract with HCl mixed in 2% caffeine solution, C = bramble extract, D = bramble extract mixed in 2% caffeine solution.


The similarity of the behaviour of the raspberry and bramble samples in the experiments described is perhaps unsurprising since they share many common anthocyanins (Figure 8).14,15 However, flowers, fruit and vegetables can contain a very rich variety of anthocyanin-containing structures, many of which are more complex.


Figure 8: Example structures of glycosylated anthocyanins present in raspberries and brambles (anthocyanin units are highlighted in red, carbohydrates are highlighted in blue).


Summary and further work

We have investigated the effect on the colour of anthocyanin-containing solutions when mixed with caffeine. The experiments conducted so far, show that addition of caffeine to anthocyanin solutions results in a shift of the absorption maximum to longer wavelengths. We think that this short initial study could provide further scope for investigation using other anthocyanin-containing plant extracts. There is a diversity of anthocyanin structures available from other vegetables, fruits or flowers, so there is potential for series of open-ended experiments for educators in classes or science clubs to investigate.


Editor Note: You may be interested in also reading Part 2 of this study.



  1. “Cabbage, colours and cleaning products: A citizen science inspired review of anthocyanin extractions that can be attempted at home” (Accessed 10th December 2023).
  2. “Aqueous red cabbage extracts: More than just a pH indicator” (Accessed 10th December 2023).
  3. “The Disappearing Rainbow Demonstration - A colourful variant using red cabbage extracts” (Accessed 10th December).
  4. “Colourful chemistry of canning” (Accessed 10th December).
  5. “Berries are red, berries are blue…I’ve got a berry surprise for you!”…i’ve-got-berry-surprise-you (Accessed 10th December).
  6. Kajiya, D. Demonstrating purple color development to students by showing the highly visual effects of aluminum ions and pH on aqueous anthocyanin solutions. J. Chem. Educ., 2020, 97, 4084-4090.
  7. Trouillas, P.; Sancho-García, J. C.; De Freitas, V.; Gierschner, J.; Otyepka, M.; Dangles, O. “Stabilizing and modulating color by copigmentation: Insights from theory and experiment”. Chem. Rev., 2016, 116, 4937-4982.
  8. Cruz, L.; Baslio, N.; Mateus, N.; de Freitas, V.; Pina, F. “Natural and synthetic flavylium-based dyes: The chemistry behind the color”. Chem. Rev., 2022, 122, 1416-1481.
  9. Yoshida, K.; Mori, M.; Kondo, T. “Blue flower color development by anthocyanins: from chemical structure to cell physiology”. Nat. Prod. Rep., 2009, 26, 884-915.
  10. Ito, T.; Aoki, D.; Fukushima, K.; Yoshida, K. Direct mapping of hydrangea blue-complex in sepal tissues of Hydrangea macrophylla. Sci. Rep., 2019, 9, 5450.
  11. Limón, P. M.; Gavara, R.; Pina, F. “Thermodynamics and kinetics of cyanidin 3-glucoside and caffeine copigments”. J. Agric. Food Chem., 2013, 61, 5245-5251.
  12. Junger, I.; Udomrungkhajornchai, S.; Grimmelsmann, N.; Blachowicz, T.; Ehrmann, A. “Effect of caffeine copigmentation of anthocyanin dyes on DSSC efficiency”, Materials, 2019, 12, 2692.
  13. Ujihara, T.; Hayashi, N. “Mechanism of copigmentation of monoglucosylrutin with caffeine” J. Agric. Food Chem., 2020, 68, 323-331.
  14. Chen, C.; Xin, X.; Zhang, H.; Yuan, Q. “Phytochemical properties and antioxidant capacities of commercial raspberry varieties”. J. Funct. Foods, 2013, 5, 508-515.
  15. Dossett, M.; Lee, J.; Finn, C. E. “Variation in anthocyanins and total phenolics of black raspberry populations”. J. Funct. Foods, 2010, 2, 292-297.


Supporting Information: Experimental procedures (and safety information) are provided for experiments described. In addition, UV-visible spectra of the relevant extracts have been provided. (Log into your ChemEd X account to access. Don't have an account? Register here for free!) 



General Safety

For Laboratory Work: Please refer to the ACS Guidelines for Chemical Laboratory Safety in Secondary Schools (2016).  

For Demonstrations: Please refer to the ACS Division of Chemical Education Safety Guidelines for Chemical Demonstrations.

Other Safety resources

RAMP: Recognize hazards; Assess the risks of hazards; Minimize the risks of hazards; Prepare for emergencies