iPhone and iPad have an accessibility option that inverts colors. This is especially good for your eyes when you are browsing webpages in your bed in the dark.

Follow these options: Settings → General → Accessibility → Triple-click Home → Toggle White on Black. After that if you triple-hit your home button, you will toggle the inverted color mode.

No more hurting your eyes.