Just get f.lux

flux-os-x-essential-utility-menu-bar-app

f.lux is a small utility app that makes the color of your computer’s display to adapt to the time of day. Running unobtrusively on the menu bar of OS X, f.lux makes your computer screen looks like your indoor lights when sun sets, so you are not blinded by the screen brightness. Download free this essential utility for your Mac.