Function scoped

  • Get progress relatively to the scope.

    Parameters

    • val: number
    • scopeValue: number[] = ...

    Returns number

    Example

    scoped(0.35, [0, 1]); // => 0.35
    scoped(0.35, [0.25, 1]); // => 0.133
    scoped(0.35, [0.25, 0.9]); // => 0.153