Recent studies have shown that exposure to blue light, particularly during night hours, can disrupt circadian rhythm and suppress the secretion of the sleep hormone melatonin. Since LEDs tend to be closer to the blue end of the light spectrum, the backlight that illuminates the screen on your Nexus 5 can easily trigger these sleep-disruptive conditions.
Similar to f.lux for Mac or PC, CF.lumen converts your phone's display to grayscale, then adds color back in with a particular prejudice towards the color blue. With root access, it automatically does this right when you need it most by using your location to determine sunrise and sunset times. For a non-root option, hit up the bottom of this guide.
Upon opening CF.lumen for the first time, CF.lumen will ask for root privileges. Grant it those, and a prompt will ask you to install the CF.lumen driver to enable changes to the display. Tap OK, and your phone will reboot so that the changes can take effect.
In order for CF.lumen to be able to automatically adjust your screen's colors at night, you'll have to supply the app with your location. From the main screen within the app, tap Location. Your current location should already be highlighted, but if not, you can set it manually by tapping a point on the map. When you are satisfied with your location, hit Save.
At this point, under Master filter mode, you will notice that Automatic is selected. This means that CF.lumen will filter out the blue spectrum of light emanating from your Nexus 5 shortly after the sun sets at your location. If you only want the core functionality of this app, you can exit setup at this time.
You can manually apply other settings, such as Daytime color filter, to change the tint of your display during daylight hours.
Ticking the box next to Sleep in the dark will apply the nighttime color settings when your phone is in any dark area. Bright light will do the opposite, making the phone's display revert to its normal colors in a bright room even after sunset. Both of these features utilize your Nexus 5's light sensor.
With the default settings applied, you won't notice any changes during daylight hours. While the sun is out, your phone will look exactly the same as it always has.
But as soon as the sun sets, you'll notice that your screen has developed a particular bias against blue light. The fact that this app converts everything to grayscale before adding colors back in means the rest of the light spectrum is still well represented.
If you should ever wish to uninstall CF.lumen, you need to first remove the driver that it installed. From within the app, tap Uninstall driver, select OK, and then wait for your phone to reboot before proceeding to uninstall the app like you would any other.
Now, not only do you understand why your device may be keeping you awake, you also have the necessary tool to alleviate that issue and get to sleep faster. Give CF.lumen a shot and let us know how it works for you.
There is a pro version available as an in-app purchase, which supports the developer, removes nags, unlocks the option to start at device boot, and adds quick settings options to the persistent notification when the filter is active.
For a non-root option, you can give the app Twilight a try. It offers much of the same functionality, but can only apply a red filter to the screen without root.