ThemeRegistration

ThemeRegistration#

class ThemeRegistration(
name: str,
kind: Literal['subclass', 'entry_point', 'alias'],
source: str,
)[source]#

Describe how a theme name became registered.

Returned by registered_themes(). kind distinguishes the registration path: a Theme subclass with a class-level _default_name ('subclass'), a pyvista.themes entry point from an installed plugin ('entry_point'), or a built-in legacy alias such as 'default' or 'vtk' ('alias').

Attributes:
namestr

The registered (normalized) theme name.

kind{‘subclass’, ‘entry_point’, ‘alias’}

How the name was registered.

sourcestr

Human-readable origin (for example, 'my_package.theme.MyTheme').

Examples#

Download Python source code | Download Jupyter notebook

Inspect how a name became registered.

>>> import pyvista as pv
>>> next(r for r in pv.registered_themes() if r.name == 'dark')
ThemeRegistration(name='dark', kind='subclass', source='pyvista.plotting.themes.DarkTheme')

Attributes#

ThemeRegistration.kind

Alias for field number 1

ThemeRegistration.name

Alias for field number 0

ThemeRegistration.source

Alias for field number 2