Height based color on spherical terrain

Hi,
i want to color the terrain based on height. But i can’t get it to work.
Slope calculation works.
Here the Material i have so far:

For example the top of a Mountain should be white, min height blue. I already can pass Max/Min height values into the Material.

Found a Way

the clamp node is not necessary.