Change Material based on Meshes Location

The material node is called World Position:

Image from Gyazo

You will need some clamps and a bit of math to make it look right.