Gradient texture on landscape based on elevation

Hello,

I would like to generate a gradient texture on a landscape, based on height.
I managed to get something close using the slolution posted here: How can I colour my terrain using a colour gradient based on the elevation?
The whole gradient is defined between a min and a max height.
What I am trying to do, is to apply this idea to each color. For example, apply a blue color for the areas of the terrain between 0 and 10 meters, red for 10 to 20m etc…
I would have to use individual colors rather than a texture, but how do I assign them each a different range?