The invention of the car meant more accidents. A Cleveland engineer, James Hoge realized this was a problem after he was involved in a collision at an intersection. Taking a cue from trains, he patented a red and green traffic light in 1917. This light helped, but attempting to stop when the light changed from red to green caused its own issues.
In 1923, inventor Garrett Morgan remodeled the light and added the amber color so that drivers would know when the light was changing giving drivers a smoother transition!
Original source can be found here.