That F.lux program works great. I have it on pc and android. It dims the pc a couple hours before you want to sleep without messing up games or video. It just fades the screen to a warm yellow when it removes the blue light. On android you can reduce the brightness down far enough to make phones and tablets usable in the dark without blinding you. It's definitely worth checking out.
I saw it just added support for those Hue led lights too. So it could auto dim all the lights in the room if you can handle fifty dollar lightbulbs.