What could be effecting my eyes? Twice I have had rainbow lights in my eyes and can hardly see for about an hour. It doesn't hurt but scares me,

Your . Your symptoms could indicate a circulation problem, or the visual aura of a migraine. It would be best for you to have a comprehensive eye examination, and an evaluation from your medical doctor.
Migraine headache. This sound like a typical visual disturbance with migraine. A mild or severe or no headache may start after the visual symptoms resolve. Women are more frequently affected than men, especially perimenstrually. There may be food allergy and stress triggers. If the symptoms are new, always the same, or frequent, then consultation with your primary care doctor or a neurologist may be a good idea.