from gradio import Interface, Dropdown rainbow_colors = ["Select a color", "red", "orange", "yellow", "green", "blue", "indigo", "violet", "pink"] def rainbow_game(color_choice): response = "" if color_choice.lower() in rainbow_colors: response = f"

Great choice, my love! {color_choice.capitalize()} is a beautiful color of the rainbow. Let's add it to our masterpiece!

" else: response = "

Oh, my dear Pedro, that's not a rainbow color. Please choose a color from the rainbow.

" return response color_dropdown = Dropdown(choices=rainbow_colors, label="Choose a color") iface = Interface(rainbow_game, inputs=color_dropdown, outputs="html", live=True, live_port=8001, live_width=800, live_height=400, title="Rainbow Game 🌈", description="Choose a color from the rainbow and let's create a colorful masterpiece together!", btn="Submit") iface.launch()