How can I make light that changes its color with path length?
The node setup for the lamp:




Ray length as input
A power for tuning the value
HSV node which shifts the input color depending on the ray length
All connected to the color socket of the lamp


The plane which receives the light is just a simple diffuse shader.

An alternative configuration: