kolor.js
function (value, min, max) {
            var interval;
            if (min > max) {
                max = min + max;
                min = max - min;
                max = max - min;
            }
            interval = max - min;
            return min + ((value % interval) + interval) % interval;
        }
function (value, min, max) {
            var interval;
            if (min > max) {
                max = min + max;
                min = max - min;
                max = max - min;
            }
            interval = max - min;
            return min + ((value % interval) + interval) % interval;
        }
function ( value , min , max ) { var interval ; if ( min > max ) { max = min + max ; min = max - min ; max = max - min ; } interval = max - min ; return min + ( ( value % interval ) + interval ) % interval ; }
Wraps a number inside a given range with modulo operation.
Wraps a number inside a given range with modulo operation .