Why are the colors red and green used in traffic light technology?

The colors were carried over from railroad technology. With railroads, signals are needed for a much different purpose. The stopping distance of a speeding train is longer than the sight distance of the engine driver. The original signal to stop a train was to build a fire between the rails. So red became the stop signal. The history of the other colors was dictated by determining the cause of railway accidents. The original colors were red, green, and white on flags. Red was danger, green was caution, and white was all clear. The caution indication was an indication that a danger condition was ahead, or that the next signal was at danger. But this presented a problem at night, when colored lanterns or spectacle lenses on signals arms were substituted for the painted or dyed surfaces used during the day. White lights were everywhere, and the engine driver often had trouble determining which light was the signal. There were several accidents where the signal lamp was out, and the engine driver mistook a streetlight for the signal light. Since white was the signal for a clear road, disaster was inevitable. Things happened rather quickly in the US. The Interstate Commerce Commission came up with three colors which were easy to produce, and could not be readily mistaken for each other or for white. They were: red for danger, yellow for caution, and green for all clear. While American railroads adopted these colors quickly, the rest of the world continued to use the old colors. When the first traffic signals appeared, many were familiar with railroad signals, and used the same colors. Yellow was left off the first signals, because the stopping distance was not longer than the sight distance (the purpose of yellow on the railroad). Also, the first signals were operated by a policeman in a tower, so he could time the clearance period for himself. When automatic signals came into use, the clearance period was needed, and the yellow light was reintroduced. But there is one difference. Green is on top in three-light railway signals.