| import gradio as gr | |
| def get_theme(): | |
| """Returns the modern theme configuration for Gradio.""" | |
| return gr.themes.Soft( | |
| primary_hue="blue", | |
| # 'steel' ya '#555555' ko 'gray' se replace kiya gaya hai | |
| secondary_hue="gray", # <-- CHANGE HERE: 'steel' ko 'gray' se replace kiya | |
| neutral_hue="gray", | |
| font=[gr.themes.GoogleFont("Roboto")], | |
| ).set( | |
| # Customizing for a dark mode feel | |
| background_gradient=[["#1e1e1e", "#2c2c2c"]], | |
| text_color="#e0e0e0" | |
| ) | |
| # Example function to set theme in a Gradio interface | |
| def set_theme_in_interface(theme_choice): | |
| if theme_choice == "Dark Mode": | |
| return get_theme() | |
| # Light mode theme ke liye simple theme return kiya gaya hai | |
| return gr.themes.Soft(primary_hue="blue").set(text_color="#e0e0e0") | |