Or.....
Tomatoe Logic

Red = output high
Green = output low
Yellow = input

the Tri-State tomatoe....