Where does this convention come from? Green = right, red = wrong

Red indicates that something is wrong and requires attention/fixing. green indicates success. Where does this convention come from? I can think of traffic lights, but that's it.

example:

check marks