/**
 * Modify the list of artists by changing the colors of their artworks using a ternary operator and list comprehensions.
 * Each artist is represented as a tuple containing their name, a list of artwork names, and a list of artwork colors.
 *
 * @param artists List of tuples representing artists.
 * @return Modified list of artists.
 *
 * Example:
 * changeColors(listOf(
 *     Triple("Van Gogh", listOf("Starry Night", "Sunflowers"), listOf("blue", "yellow")),
 *     Triple("Da Vinci", listOf("Mona Lisa", "The Last Supper"), listOf("green", "brown")),
 *     Triple("Picasso", listOf("Guernica", "Les Demoiselles d'Avignon"), listOf("red", "pink"))
 * ))
 *
 * Output:
 * listOf(
 *     Triple("Van Gogh", listOf("Starry Night", "Sunflowers"), listOf("dark blue", "light yellow")),
 *     Triple("Da Vinci", listOf("Mona Lisa", "The Last Supper"), listOf("dark green", "dark brown")),
 *     Triple("Picasso", listOf("Guernica", "Les Demoiselles d'Avignon"), listOf("dark red", "light pink"))
 * )
 */
fun changeColors(artists: List<Triple<String, List<String>, List<String>>>): List<Triple<String, List<String>, List<String>>> {

    return artists.map { (name, artworks, colors) ->
        Triple(name, artworks, colors.map { color ->
            if (color == "blue" || color == "green" || color == "red") "dark $color"
            else "light $color"
        })
    }
}
/**
 * Modify the list of artists by changing the colors of their artworks using a ternary operator and list comprehensions.
 * Each artist is represented as a tuple containing their name, a list of artwork names, and a list of artwork colors.
 *
 * @param artists List of tuples representing artists.
 * @return Modified list of artists.
 *
 * Example:
 * changeColors(listOf(
 *     Triple("Van Gogh", listOf("Starry Night", "Sunflowers"), listOf("blue", "yellow")),
 *     Triple("Da Vinci", listOf("Mona Lisa", "The Last Supper"), listOf("green", "brown")),
 *     Triple("Picasso", listOf("Guernica", "Les Demoiselles d'Avignon"), listOf("red", "pink"))
 * ))
 *
 * Output:
 * listOf(
 *     Triple("Van Gogh", listOf("Starry Night", "Sunflowers"), listOf("dark blue", "light yellow")),
 *     Triple("Da Vinci", listOf("Mona Lisa", "The Last Supper"), listOf("dark green", "dark brown")),
 *     Triple("Picasso", listOf("Guernica", "Les Demoiselles d'Avignon"), listOf("dark red", "light pink"))
 * )
 */
fun changeColors(artists: List<Triple<String, List<String>, List<String>>>): List<Triple<String, List<String>, List<String>>> {
/**
 * Modify the list of artists by changing the colors of their artworks using a ternary operator and list comprehensions.
 * Each artist is represented as a tuple containing their name, a list of artwork names, and a list of artwork colors.
 *
 * @param artists List of tuples representing artists.
 * @return Modified list of artists.
 *
 * Example:
 * changeColors(listOf(
 *     Triple("Van Gogh", listOf("Starry Night", "Sunflowers"), listOf("blue", "yellow")),
 *     Triple("Da Vinci", listOf("Mona Lisa", "The Last Supper"), listOf("green", "brown")),
 *     Triple("Picasso", listOf("Guernica", "Les Demoiselles d'Avignon"), listOf("red", "pink"))
 * ))
 *
 * Output:
 * listOf(
 *     Triple("Van Gogh", listOf("Starry Night", "Sunflowers"), listOf("dark blue", "light yellow")),
 *     Triple("Da Vinci", listOf("Mona Lisa", "The Last Supper"), listOf("dark green", "dark brown")),
 *     Triple("Picasso", listOf("Guernica", "Les Demoiselles d'Avignon"), listOf("dark red", "light pink"))
 * )
 */
fun changeColors(artists: List<Triple<String, List<String>, List<String>>>): List<Triple<String, List<String>, List<String>>> {

    return artists.map { (name, artworks, colors) ->
        Triple(name, artworks, colors.map { color ->
            if (color == "blue" || color == "green" || color == "red") "dark $color"
            else "light $color"
        })
    }
}