Why do traffic lights have red, yellow and green color? Why dont they use other colors?

Colors that go with purple and yellow

This is a warning to drivers that the light is about to turn green.

This is very beneficial in countries where drivers use a stickshift and/or stop their engines at red lights.

,For stickshift drivers, it means that they can sit in neutral and when they get red & yellow, they can then shift into first.

This minimizes the time that they have to be on the clutch, which is good for the car.