I tried to design this without much success so any help would be appreciated.
A circuit where initially in a 3-pin Bi-Color LED (Common Cathode), the red led illuminates. Then it switches off and the green led illuminates, when an external voltage is applied.
for example: initial state: external voltage 0V -> red led on, green led off
external voltage changes to 5V (or any) -> red led goes off, green led turns on
if the external voltage changes back to zero it resets the leds to the initial state.
--Just to clarify
This discrete (transistor) circuit is powered by a positive voltage supply between 15-45V. Being a transistor circuit the resistors can be adjusted for different voltages.
An external voltage that can be 0V or +5V will dictate which led lights up.
0V lights up the red led (initial state)
+5V turns off the red and lights up the green.
The transistor circuit that AnalogKid showed (third on the last image) fits the bill with the exception that it operates with Ground and +5V instead of the 0V and +5V required in this application.
This is what I had tried with V+ between 15-45V
I tried something along the these lines but could not get the same current on both leds. Also tried adding a trimmer to adjust the current (brightness) but that didn't work correctly, and that would be the preferred solution instead of replacing resistors to get the same brightness on both leds.