Get a syntax theme instance.
(cls, name: Union[str, SyntaxTheme])
| 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, |
no test coverage detected