Code Pad

I saw a code-pad today. Something made me want to try a code.
I pressed four digits without any deeper thought, and the display went green.
I tried to door. It was open.

I let it go and the pad went red.
When I tried the door again, it was locked.

Somehow I managed to guess a combination out of ten-thousand on the first try.