static int blendMultipleColorsToInt(LPair colors) { double sum = doubleSum(pairsB(colors)); double r = 0, g = 0, b = 0; for (color, weight : unpair colors) { r += color.getRed()*weight; g += color.getGreen()*weight; b += color.getBlue()*weight; } ret rgbInt( roundedRatio(r, sum), roundedRatio(g, sum), roundedRatio(b, sum)); } static int blendMultipleColorsToInt(Color[] colors, double[] weights) { double sum = doubleSum(weights); double r = 0, g = 0, b = 0; for i over colors: { Color color = colors[i]; double weight = weights[i]; r += color.getRed()*weight; g += color.getGreen()*weight; b += color.getBlue()*weight; } ret rgbInt( roundedRatio(r, sum), roundedRatio(g, sum), roundedRatio(b, sum)); }