Function clampScope

  • Get progress relatively to the scope and clamp it within two points

    Parameters

    • value: number
    • scopeProp: number[] = ...
    • clampProp: number[] = ...

    Returns number

    Example

    clampScope(0.38, [0.35, 1]); // => 0.046
    clampScope(0.38, [0.35, 1], [0.1, 1]); // => 0.1