Bi color led with tri-state pin (high->D1, tri-state->D2, low->off)
Assuming a 3-pin LED common anode it can be done as follows: 







simulate this circuit &ndash; Schematic created using CircuitLab
. 

If it's acceptable to have both LEDs on for a high input (which would give you
red + yellow or green + yellow for a red/green LED) you can reduce it to just 
two components total (plus the LED) by using a prebiased array for Q1/Q2, a resistor array for R3/R4 and eliminate Q3/R5. 







simulate this circuit