This happens to me from time to time, often when I'm dehydrated, or stressed. While I have experienced this while at rest, it happens most often in connection with bending over
It is a phenomenon ironically known as an aura. I say ironically because it is not caused by the presence of a spiritual being, or angles, but from pressure on the optic nerve. This is the same mechanism that causes migraines, and is often called a visual migraine by many neurologists. In this case high blood pressure in the brain acts on the part of your brain responsible for sight, and showing us sparkles, rather than acting on another part and causing pain.
Personally I prefer the pretty sparkles to the debilitating effects of a more classic migraine.
This is mostly harmless, but in some cases may point to more serious issues. If you have a history of migraines in your family you may want to look into it with your doctor.
When this happens in the future, enjoy the pretty show, but also ask yourself questions like, Have I eaten well today? Have I had enough water? It is more likely that your body is trying to tell you something than a spirit.