/**
 * This function takes a nested dictionary representing a graphic design and a color as input, and returns the value associated with that color.
 *
 * @param designDictionary A nested dictionary representing the graphic design
 * @param color The color to search for
 * @return The value associated with the given color
 */
fun findColorValue(designDictionary: Map<String, Map<String, Map<String, String>>>, color: String): String? {

    // Iterate through each layer in the design dictionary
    for (layer in designDictionary.values) {
        // Iterate through each shape in the current layer
        for (shape in layer.values) {
            // Check if the current shape contains the given color
            if (color in shape) {
                // Return the value associated with the color
                return shape[color]
            }
        }
    }
    // If the color is not found, return null
    return null
}

// Define a nested dictionary representing a graphic design
val design = mapOf(
    "layer1" to mapOf(
        "shape1" to mapOf(
            "red" to "#FF0000",
            "green" to "#00FF00",
            "blue" to "#0000FF"
        ),
        "shape2" to mapOf(
            "red" to "#FF0000",
            "yellow" to "#FFFF00"
        )
    )
)
/**
 * This function takes a nested dictionary representing a graphic design and a color as input, and returns the value associated with that color.
 *
 * @param designDictionary A nested dictionary representing the graphic design
 * @param color The color to search for
 * @return The value associated with the given color
 */
fun findColorValue(designDictionary: Map<String, Map<String, Map<String, String>>>, color: String): String? {
/**
 * This function takes a nested dictionary representing a graphic design and a color as input, and returns the value associated with that color.
 *
 * @param designDictionary A nested dictionary representing the graphic design
 * @param color The color to search for
 * @return The value associated with the given color
 */
fun findColorValue(designDictionary: Map<String, Map<String, Map<String, String>>>, color: String): String? {

    // Iterate through each layer in the design dictionary
    for (layer in designDictionary.values) {
        // Iterate through each shape in the current layer
        for (shape in layer.values) {
            // Check if the current shape contains the given color
            if (color in shape) {
                // Return the value associated with the color
                return shape[color]
            }
        }
    }
    // If the color is not found, return null
    return null
}

// Define a nested dictionary representing a graphic design
val design = mapOf(
    "layer1" to mapOf(
        "shape1" to mapOf(
            "red" to "#FF0000",
            "green" to "#00FF00",
            "blue" to "#0000FF"
        ),
        "shape2" to mapOf(
            "red" to "#FF0000",
            "yellow" to "#FFFF00"
        )
    )
)