Skip to content

trading_agent.terminal.terminal_themes

The terminal program's dark and light themes, in the web page's colours.

Typical usage example:

for theme in TerminalThemes().all(): app.register_theme(theme) app.theme = TerminalThemes.DARK

TerminalThemes

The two themes, coloured like the web page's tokens.css.

all

all()

Both themes.

Returns:

Type Description
list[Theme]

The dark theme, then the light theme.

Source code in src/trading_agent/terminal/terminal_themes.py
def all(self) -> list[theme_module.Theme]:
    """Both themes.

    Returns:
        list[theme_module.Theme]: The dark theme, then the light theme.
    """
    return [
        self._dark(),
        self._light(),
    ]

other

other(name)

The theme to switch to from the current one.

Parameters:

Name Type Description Default
name str

The current theme's name.

required

Returns:

Type Description
str

The light theme's name when the dark one is current, otherwise the dark theme's name.

Source code in src/trading_agent/terminal/terminal_themes.py
def other(self, name: str) -> str:
    """The theme to switch to from the current one.

    Args:
        name (str): The current theme's name.

    Returns:
        str: The light theme's name when the dark one is current, otherwise the dark theme's name.
    """
    if name == self.DARK:
        return self.LIGHT
    return self.DARK