Clamp value between the minimum and maximum
minimum value to return
the value to return if it is between min and max
maximum value to return
Clamp value between the minimum and maximum