It appears that pH inside the plant cell has an affect as well:
Sepal Color Variation of Hydrangea macrophylla and Vacuolar pH Measured with a Proton-Selective Microelectrode[Emphasis added.]
Anthocyanin changes its color depending on pH (Goto 1987, Brouillard 1988, Goto and Kondo 1991). In strong acidic conditions it shows red, in neutral, purple and in alkaline, blue. But generally the vacuolar pH of plant cells is weakly acidic and, under such conditions, almost all anthocyanins are purple and very unstable. From recent work, the following three mechanisms have been proposed for flower color variation: metal chelation, vacuolar pH change and molecular associations (Goto 1987, Goto and Kondo 1991, Brouillard and Dangles 1994, Mol et al. 1998).
We found that the pH of the solution exerted a considerable effect on color development, suggesting that the vacuolar pH may be different between blue and red sepals (Kondo et al. 1999, Yoshida et al. 2002). However, there are only two reports describing hydrangea color and flower pH. Robinson and Robinson (1939) suggested that red flowers were slightly more acidic than their blue counterparts and Stewart et al. (1975) reported that the pH of pink colored sepals was 4.0.
So soil pH has an affect on the colour of hydrangea flowers (by affecting the uptake of Aluminum from the soil) but so does the pH of the plant cell. Oh and in case you were wondering which specific anthocyanin is responsible for the hydrangea colours it's delphinidin 3-glucoside accompanied by one of three (colourless) co-pigments, 5-O-caffeoyl quinic acid, 5-O-p-coumaroyl quinic acid, and 3-O-caffeoyl quinic acid.