Ever see colored lights or swirls when you close your eyes? That phenomenon is called a phosphene. The eyes react to some stimuli other than light to create a similar effect to exposure to light.
If you close your eyes tight and push on your eyelids, wait a few seconds. It's probably bad for you, so don't do it a lot.