/**
 * Given a list of tuples representing colors and a color name,
 * find and return the index of the color tuple that matches the given color name.
 * If the color name is not found, return -1.
 *
 * @param colors A list of tuples representing colors. Each tuple contains the color name, RGB values, and HEX code.
 * @param colorName The name of the color to search for.
 * @return The index of the color tuple that matches the given color name or -1 if not found.
 */
fun getColorIndex(colors: List<Triple<String, String, String>>, colorName: String): Int {

    // Iterate through the colors list using a for loop
    for ((index, color) in colors.withIndex()) {
        // Check if the color name in the current tuple matches the given color name
        if (color.first == colorName) {
            // Return the index of the color tuple
            return index
        }
    }
    // If the color name is not found, return -1
    return -1
}
/**
 * Given a list of tuples representing colors and a color name,
 * find and return the index of the color tuple that matches the given color name.
 * If the color name is not found, return -1.
 *
 * @param colors A list of tuples representing colors. Each tuple contains the color name, RGB values, and HEX code.
 * @param colorName The name of the color to search for.
 * @return The index of the color tuple that matches the given color name or -1 if not found.
 */
fun getColorIndex(colors: List<Triple<String, String, String>>, colorName: String): Int {
/**
 * Given a list of tuples representing colors and a color name,
 * find and return the index of the color tuple that matches the given color name.
 * If the color name is not found, return -1.
 *
 * @param colors A list of tuples representing colors. Each tuple contains the color name, RGB values, and HEX code.
 * @param colorName The name of the color to search for.
 * @return The index of the color tuple that matches the given color name or -1 if not found.
 */
fun getColorIndex(colors: List<Triple<String, String, String>>, colorName: String): Int {

    // Iterate through the colors list using a for loop
    for ((index, color) in colors.withIndex()) {
        // Check if the color name in the current tuple matches the given color name
        if (color.first == colorName) {
            // Return the index of the color tuple
            return index
        }
    }
    // If the color name is not found, return -1
    return -1
}