1function pickHex(color1, color2, weight) {
2 var w1 = weight;
3 var w2 = 1 - w1;
4 var rgb = [Math.round(color1[0] * w1 + color2[0] * w2),
5 Math.round(color1[1] * w1 + color2[1] * w2),
6 Math.round(color1[2] * w1 + color2[2] * w2)];
7 return rgb;
8}