function getRandomColor() { ranges = [ [100,250], [100,170], [200,250] ]; var g = function() { //select random range and remove var range = ranges.splice(Math.floor(Math.random()*ranges.length), 1)[0]; //pick a random number from within the range return Math.floor(Math.random() * (range[1] - range[0])) + range[0]; } return \"rgb(\" + g() + \",\" + g() + \",\" + g() +\")\"; };