It ain't very impressive but here:
minmax.lua - Sets White and Black/Max and Min values
Turn on auto to automatically get the highest and lowest value, or you can fine-tune it manually.
edit: Just noticed navot's brightness node already has a Min/Max. Oops.