function getColor(_int, max = 1000) {
var fff = 16 * 16 * 16;
var color = [];
_int = Math.round(fff * _int / max);
for (var i = 0; i < 3; ++i) {
color.push(16 * (_int % 16));
_int = Math.floor(_int / 16);
}
return "rgb(" + color.join(',') + ")";
}