If I close my eyes I see a really colourful shape and then if I open my eyes I can see it there. It happens usually when I'm tired. It's just like random shapes. One time, when I was ill, I was out with my friends and I got loads of the shapes in front of my eyes then fainted.

What could this be?