def to_dict(self):
        """Convert the theme into a python dictionary."""
        schema = {"theme": {}}
        for prop in dir(self):
            if (
                not prop.startswith("_")
                or prop.startswith("_font")
                or prop in ("_stylesheets", "name")
            ) and isinstance(getattr(self, prop), (list, str)):
                schema["theme"][prop] = getattr(self, prop)
        return schema
Convert the theme into a python dictionary.
gradio/themes/base.py