How R, G & B values map to depth?

How can I calculate distance related to r g & b values for each pixel?

Okay.
I "solved it.
Depth map is encoded as HSL while hue (h) means depth.

Hey Julien, thanks for chatting through your questions and goals earlier. We would love to see the results of your experiments if you are willing to share!