inverted calculation for darkness