Arduino project: ultrasonic sensor + 5M 5050 RGB LED strip lights
If you look closely at the LED strip, besides the LEDs, you'll see there are black surface mount resistors on the strip. So you don't need any resistors for the strip.

However you can't just power a 12V strip directly from an Arduino 5V pin. You'd need a MOSFET or power-transistor for those kinds of voltage and currents.

Here's a tutorial for the RGB LED strip.

And here's one for Reading the ultrasonic sensor.

I don't see why you need an example that precisely matches yours. Just read the distance; based on that distance calculate a color; send that color to the LED strip. It's more fun if it hasn't been done for you.