Assuming the voltage sources driving the anode pins are 5V, the voltages on those pins are clamped at 2.1V and 1.8V by the LED forward voltages and neither voltage source provides a low impedance to ground when inactive then something like this should do what you want :
The three pins are A,B,C.
If, however, the voltage sources do provide a low impedance to ground when inactive then all you need is R1/D1/D2.