from __future__ import annotations from typing import Iterable import gradio as gr from gradio.themes.base import Base from gradio.themes.utils import colors, fonts, sizes from gradio.themes.utils.colors import Color IBM_blue = Color( name="blue", c50="#edf5ff", c100="#d0e2ff", c200="#bfdbfe", c300="#a6c8ff", c400="#78a9ff", c500="#4589ff", c600="#0f62fe", c700="#0043ce", c800="#002d9c", c900="#001d6c", c950="#001141", ) class IBMTheme(Base): def __init__( self, *, primary_hue: colors.Color | str = IBM_blue, # secondary_hue: colors.Color | str = colors.blue, # neutral_hue: colors.Color | str = colors.blue, # spacing_size: sizes.Size | str = sizes.spacing_md, # radius_size: sizes.Size | str = sizes.radius_md, # text_size: sizes.Size | str = sizes.text_lg, # font: fonts.Font # | str # | Iterable[fonts.Font | str] = ( # fonts.GoogleFont("Quicksand"), # "ui-sans-serif", # "sans-serif", # ), font_mono: fonts.Font | str | Iterable[fonts.Font | str] = ( fonts.GoogleFont("IBM Plex Mono"), "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( body_background_fill="#8d8d8d @ 12%", body_text_color_dark="white", body_text_color="#161616", body_background_fill_dark="", # button_primary_background_fill="linear-gradient(90deg, *primary_300, *secondary_400)", # button_primary_background_fill_hover="linear-gradient(90deg, *primary_200, *secondary_300)", button_primary_text_color="white", button_primary_text_color_dark="white", # button_primary_background_fill_dark="linear-gradient(90deg, *primary_600, *secondary_800)", # slider_color="*secondary_300", # slider_color_dark="*secondary_600", # block_title_text_weight="600", block_border_width="3px", block_border_color=IBM_blue.c500, block_info_text_color="#990000", # button_primary_shadow="*shadow_drop_lg", # button_large_padding="32px", )