• Clamps the value to be within the specifed range.

    Parameters

    • x: number

      The input value.

    • min: number = 0

      The minimum ouput value.

    • max: number = 1

      The maximum output value.

    Returns number

    The value clamped within the range.