UNPKG

@googleforcreators/units

Version:

A collection of utility functions as well as a React context provider for dealing with "data" and "editor" pixels in the Web Stories editor.

3 lines (2 loc) 294 B
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=(e,{MIN:t,MAX:r})=>Math.min(Math.max(e,t),r);exports.clamp=e,exports.lerp=(e,t)=>(1-e)*t.MIN+e*t.MAX,exports.progress=(t,r)=>{const s=e(t,r)-r.MIN,M=r.MAX-r.MIN;return Math.abs(s/M)}; //# sourceMappingURL=range.js.map