@enact/ui
Version:
A collection of simplified unstyled cross-platform UI components for Enact
15 lines (14 loc) • 338 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.calcProportion = void 0;
var calcProportion = exports.calcProportion = function calcProportion(min, max, value) {
if (value <= min) {
return 0;
} else if (value >= max) {
return 1;
} else {
return (value - min) / (max - min);
}
};