Colored (non-white) varieties of hydrangeas can be changed from blue to purplish to pink depending on the acidity and availability of aluminum in the soil. There are several posts on this site relating to this information in more detail.
In the simplest of terms:
More acidic and aluminum available = blue flowers.
More basic (alkaline) and less available aluminum = pink flowers.
It is hard to maintain a purple hydrangea - you can keep them at one extreme to the other, but its hard to balance for purple. Most soils tend to have available aluminum so fighting the aluminum can be hard. Use Aluminum Sulfate to maintain available aluminum and slight acidity to keep them blue. But be careful when adding aluminum sulfate, because too much is a bad thing! Hydrangeas tend to be pastel in color and the depth of color you can obtain is limited.
From the Frozen Tundra