Sensor for distance?

Hmmm…I wonder if I could incorporate the idea in this thread to make it work.

A laser trip sensor that reads as open/closed.
When the garage opens, enable laser, turn the RGB controller on and color to Red.
When car pulls in and trips the sensor the lights turn Green indicating it is far enough in.

Idk…I need to buy some stuff and play around (and figure out how to write apps…).