function clampValue (val, min, max) {
  if (val > max) {
    return max
  }
  if (val < min) {
    return min
  }
  return val
}
Clamps provided value within domain
@param {Number} val Value
@param {Number} min Minimum value
@param {Number} max Maximum value
@returns {Number} clamped value