mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-25 14:36:13 +01:00
5 lines
160 B
Text
5 lines
160 B
Text
|
function value_map(_val, _omin, _omax, _nmin, _nmax) {
|
||
|
if(_omax == _omin) return _nmin;
|
||
|
|
||
|
return _nmin + (_val - _omin) / (_omax - _omin) * (_nmax - _nmin);
|
||
|
}
|