All around the country, traffic lights help maintain order on roadways by signaling when it’s time to stop (red), slow down (yellow), or continue (green). While the color scheme appears obvious now, it had to have been created and invented somewhere. Here’s how we arrived at these beacons of the transit system.

According to Today I Found Out, traffic lights have origins in the railroad systems of the 1800s. Train engineers needed a way to know when to stop their locomotives and when to slow down. Red was selected for stop since most people associate it with something potentially perilous or serious. (More importantly, red has the longest wavelength on the color spectrum and can be seen from greater distances, allowing operators to begin slowing down sooner.) They also used a white light to indicate a conductor could go and a green light when they were to use caution.

This worked, until it didn’t. Since two of the lights had a colored filter, confusion resulted if one of the lenses fell off, revealing a white light. If a red filter was damaged, for example, a conductor would see the white light and think it was safe to go when it wasn’t. Legend has it that stars could also be mistaken for the lights, causing accidents. To avoid that problem, white was eliminated, yellow was added to indicate caution, and green was shifted to signal it was time to proceed.

Over in England, the railroad system was being adopted for traffic lights, even though there technically wasn’t any vehicular traffic. Instead, people were concerned about horse-drawn carriages moving through town and posing a danger to pedestrians. Railway manager John Peake Knight noticed the issue and told London’s Metropolitan Police he had a solution: a semaphore system that used signals manually raised or lowered by police officers to signal to carriage drivers to stop or slow down. At night, gas-powered red and green lights were used. Thanks to a gas explosion, however, the system didn’t last long.

By the early 1900s, however, it was clear something effective had to be done. In 1913, the year the Ford Model T was introduced, there were more than 4000 casualties on roads, many as a result of intersection collisions. The United States used law enforcement to enforce traffic, using the semaphore method of arm waving to direct vehicles. It was Cleveland engineer James Hoge who suggested tapping into the trolley system to power red and green lights like the ones used on railways. This system didn’t utilize yellow, with officers preferring to blow a whistle to let drivers know the signal was about to change. It wasn’t until 1920 that a Detroit police officer named William L. Potts devised the three-colored system—red, yellow, and green. A few years later, the lights started changing during timed intervals. If it turned red and no traffic was around, a driver could honk to get it to change.

Not all locations used the same colors, however. To avoid confusion, the Federal Highway Administration mandated the red, yellow, and green color scheme in 1935. It also set guidelines for road signs and pavement markings, standardizing many of the road information we see today.

[h/t Today I Found Out]