summaryrefslogtreecommitdiffstats
path: root/res/qml/Mixxx/MathUtils.mjs
blob: e7b500b7b46a0094fa5cf5d17c07c2518b2c4c50 (plain)
1
2
3
4
5
6
7
8
9
/**
 * @param {number} value Value
 * @param {number} min Lower bound
 * @param {number} max Upper bound
 * @returns {number} Value clamped between min and max
 */
export const clamp = function(value, min, max) {
    return Math.max(Math.min(value, max), min);
};