Aside from a custom node, what is a better way to handle this logic?

I want to set the color based on the height:

Seems inefficient to run 3 conditionals and 3 branches. I know I can create a custom node but was wondering if there was something built into shader graph that could be used instead.

Gradient or sample gradient (ramp) texture to remap height to color.

Thanks I will try that.