BTW this sketch will cause the light to be red at low voltages and green at 5 volts, and orange when the voltage is in the middle. It fades continuously from one color to another in proportion to the voltage changes. This was JohnRob's take on it.
Again, you can view the full sketch here:
https://create.arduino.cc/editor/ado88/c09ae657-4be8-4687-8d1f-726801bcb99e/preview