mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-11-15 06:53:59 +01:00
5 lines
160 B
Plaintext
5 lines
160 B
Plaintext
|
function value_map(_val, _omin, _omax, _nmin, _nmax) {
|
||
|
if(_omax == _omin) return _nmin;
|
||
|
|
||
|
return _nmin + (_val - _omin) / (_omax - _omin) * (_nmax - _nmin);
|
||
|
}
|