/**
 * Given a list of colors in RGB format, calculate and return the average color
 */
fun calculateAverageColor(colors: List<Triple<Int, Int, Int>>): Triple<Int, Int, Int> {

    // Initialize variables for summing the RGB values
    var totalRed = 0
    var totalGreen = 0
    var totalBlue = 0

    // Iterate over each color
    for (color in colors) {
        // Retrieve the individual RGB values from the Triple
        val (red, green, blue) = color

        // Accumulate the sum of RGB values
        totalRed += red
        totalGreen += green
        totalBlue += blue
    }

    // Calculate the average RGB values
    val averageRed = totalRed / colors.size
    val averageGreen = totalGreen / colors.size
    val averageBlue = totalBlue / colors.size

    // Return the average color as a Triple
    return Triple(averageRed, averageGreen, averageBlue)
}
/**
 * Given a list of colors in RGB format, calculate and return the average color
 */
fun calculateAverageColor(colors: List<Triple<Int, Int, Int>>): Triple<Int, Int, Int> {
/**
 * Given a list of colors in RGB format, calculate and return the average color
 */
fun calculateAverageColor(colors: List<Triple<Int, Int, Int>>): Triple<Int, Int, Int> {

    // Initialize variables for summing the RGB values
    var totalRed = 0
    var totalGreen = 0
    var totalBlue = 0

    // Iterate over each color
    for (color in colors) {
        // Retrieve the individual RGB values from the Triple
        val (red, green, blue) = color

        // Accumulate the sum of RGB values
        totalRed += red
        totalGreen += green
        totalBlue += blue
    }

    // Calculate the average RGB values
    val averageRed = totalRed / colors.size
    val averageGreen = totalGreen / colors.size
    val averageBlue = totalBlue / colors.size

    // Return the average color as a Triple
    return Triple(averageRed, averageGreen, averageBlue)
}