Taking damage from the "dark"

So maybe the wrong place to put this but I am looking for a way to have my player take damage from the “dark” aka being in an area that isnt lit.

Are there any examples of how to do this that anyone knows of?