CyanogenMod has it built-in, called LiveDisplay (and even a default tile in quick settings for toggling it).
CM has its own issues though. For example nexus 5 gets monthly security patches from upstream right now, but CM-13 for the same model was last updated in September 2015 :/
Android has adaptive brightness, which goes some way towards the goal.
Unfortunately you can't have any app drawing directly on the screen if you want to change privileges. That means I had to choose between silly-bright screen or more secure system... and that's a terrible tradeoff to present to users.