It’s hydrangea season, and we love this flowering shrub in all its many and glorious forms, from the pale-green, cloudlike blooms of the ‘Limelight’ cultivar to our beloved Southeastern native, oakleaf, whose blooms start white and gradually take on a rosy tinge with age.

But let’s face it. It’s those masses of vibrant blue, pink, and purple blooms that stop our scroll on social media every summer. These are the bigleaf and mountain hydrangea types, and their color can change with the soil chemistry—sometimes you even see all those colors on a single bush!

Country Living’s resident garden expert Charlyne Mattox explains: “Your blooms’ color is affected by how much aluminum your plants can take up, and this is determined by how alkaline, neutral, or acidic your soil is. When the soil is acidic, typically more aluminum will be available; this results in blue hydrangea blooms. The opposite is true if the soil is neutral or alkaline, giving you purple or pink hydrangea blooms.”

While it won’t work for every hydrangea, adjusting your soil’s pH balance and nutrient level can change the color of some plants’ blooms. To find out the pH and nutrient makeup of your soil, submit a sample to your local extension office. Be sure to specify why you are requesting the sample, and they can usually offer targeted fertilizers and quantities. Be patient—seeing results may take several seasons.

Here are the basics:

If You Want Pink Hydrangea Blooms

You’ll need alkaline soil (pH 7 or higher). To adjust, follow the extension’s recommendation or try adding 1 tablespoon of garden lime per gallon of water directly to the roots.

If You Want Blue Hydrangea Blooms

You’ll need acidic soil (pH 5 or lower). To adjust, follow the extension’s recommendation or try adding 1 tablespoon of aluminum sulfate per gallon of water directly to the roots.

If You Want Purple Hydrangea Blooms

You’ll need neutral soil (pH 6 to 7). To adjust, follow the extension’s recommendation or add either garden lime or aluminum sulfate to create a soil that is in the neutral range.