MCPcopy
hub / github.com/Textualize/rich / get_theme

Method get_theme

rich/syntax.py:268–277  ·  rich/syntax.py::Syntax.get_theme

Get a syntax theme instance.

(cls, name: Union[str, SyntaxTheme])

Source from the content-addressed store, hash-verified

266
267 @classmethod
268 def get_theme(cls, name: Union[str, SyntaxTheme]) -> SyntaxTheme:
269 class="st">""class="st">"Get a syntax theme instance."class="st">""
270 if isinstance(name, SyntaxTheme):
271 return name
272 theme: SyntaxTheme
273 if name in RICH_SYNTAX_THEMES:
274 theme = ANSISyntaxTheme(RICH_SYNTAX_THEMES[name])
275 else:
276 theme = PygmentsSyntaxTheme(name)
277 return theme
278
279 def __init__(
280 self,

Callers 2

__init__Method · 0.95
__init__Method · 0.80

Calls 2

ANSISyntaxThemeClass · 0.85
PygmentsSyntaxThemeClass · 0.85

Tested by

no test coverage detected