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