How can there be a script that detects what what another users fg/bg colours are?

I'm not sure if you quite understood what i was saying, although I can't think of a way to make it any clearer