Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| from gradio.themes.base import Base | |
| from gradio.themes.utils import colors, fonts, sizes | |
| # Custom Theme Class | |
| class FastRTCOrangeTheme(Base): | |
| def __init__( | |
| self, | |
| *, | |
| primary_hue=colors.orange, | |
| secondary_hue=colors.amber, | |
| neutral_hue=colors.gray, | |
| spacing_size=sizes.spacing_md, | |
| radius_size=sizes.radius_lg, | |
| text_size=sizes.text_md, | |
| font=(fonts.GoogleFont("Poppins"), "ui-sans-serif", "sans-serif"), | |
| font_mono=(fonts.GoogleFont("Fira Code"), "ui-monospace", "monospace"), | |
| ): | |
| super().__init__( | |
| primary_hue=primary_hue, | |
| secondary_hue=secondary_hue, | |
| neutral_hue=neutral_hue, | |
| spacing_size=spacing_size, | |
| radius_size=radius_size, | |
| text_size=text_size, | |
| font=font, | |
| font_mono=font_mono, | |
| ) | |
| super().set( | |
| # Background & Layout | |
| body_background_fill="linear-gradient(135deg, #FFF7ED, #FFEDD5)", | |
| body_text_color="#000000", | |
| # Block / Panels | |
| block_background_fill="white", | |
| block_shadow="0 4px 12px rgba(0, 0, 0, 0.05)", | |
| block_border_width="1px", | |
| block_title_text_weight="700", | |
| # Buttons (Primary: Orange) | |
| button_primary_background_fill="linear-gradient(90deg, #F97316, #FB923C)", # Orange gradient | |
| button_primary_background_fill_hover="linear-gradient(90deg, #EA580C, #F97316)", | |
| button_primary_text_color="white", | |
| button_primary_shadow="0 2px 6px rgba(251, 146, 60, 0.4)", | |
| # Buttons (Secondary: Subtle Neutral) | |
| button_secondary_background_fill="#F8FAFC", | |
| button_secondary_text_color="#1F2937", | |
| button_secondary_shadow="0 1px 3px rgba(0, 0, 0, 0.1)", | |
| # Sliders, Inputs | |
| slider_color="#F97316", # Orange slider | |
| input_border_color="#E2E8F0", | |
| input_border_color_focus="#F97316", | |
| input_shadow="0 0 0 2px rgba(249, 115, 22, 0.2)", | |
| # Loader & Progress | |
| loader_color="#FB923C", | |
| # Links & Highlights | |
| link_text_color="#F97316", | |
| link_text_color_hover="#EA580C" | |
| ) | |
| fast_rtc_theme = FastRTCOrangeTheme() |