progress

progress returns the progress of a value in a given range.

Progress is represented as a number between 0 and 1, but is unclamped.

Import

import { progress } from '@popmotion/popcorn';

Usage

progress(100, -100, 50); // 0.25
progress(100, -100, -300); // 2

Types

progress(from: number, to: number, value: number): number