• Returns the value itself if it's between min and max. Returns min if the value is lower than min. Returns max if the value is greater than max.

    Returns

    the clamped value

    Parameters

    • value: number

      the value to clmap

    • Optional min: number

      the min value to clamp to (default: 0)

    • Optional max: number

      the max value to clamp to (default: 1)

    Returns number