function averageColor(colors) {
  const total = colors.reduce(
    (acc, [r, g, b]) => [acc[0] + r, acc[1] + g, acc[2] + b],
    [0, 0, 0],
  );
  return total.map(c => Math.round(c / colors.length));
}
Calculates the average color of an array of colors.
@param {number[][]} colors - The array of rgb.
@returns {number[]} The average rgb.