JavaScript utility for generating heat map colors for arrays of values