Signaling light -- code ideas

Getting ready to install a signaling light, just for fun really.

Pseudo-design:
A single hue lightbulb that responds with flashing colors to signal different sensor states (mostly binary sensors). For example, if the mailbox sensor has been triggered (motion sensor), flash red. If the back door is left open (door sensor), flash yellow.

The rub is, I want the system to smartly recombine all the possible permutations. So, if both sensors are in the on state, for example, the light flashes red, then yellow, then red, rinse repeat. Ideally, this would work for any number of sensors (though this would quickly get out of hang).

I have a few ideas, but I wanted to see if any of the bigger brained individuals here have thoughts of the smarter, more experienced variety than I can muster.

Thanks!
Justin