Most likely rubbing eyes. However if reoccurs WITHOUT rubbing eyes see an Eye MD ophthalmologist.
JCH MD
I mean i have rubbed my eyes the same way before. Nothing happened like this. Is this just from rubbing eyes or could be something else?
Stop doing that, its not good for your eyes. The light can come from compression of the vitreous and stimulation of the retina due to pressure. It's referred to an an "entopic" phenomena.
JCHMD