Increase the length of the z-buffer
Your setup is fine. You take depth Values (a number of some value per pixel representable as an grey scale image). And dependent on this number you chose a color from the HSL spectrum. 
So you just need to scale your depth value right to controle for which depth wich color should apere.