Skip to content

API turboframe.ui.colors

rafageist edited this page Dec 4, 2026 · 4 revisions

turboframe.ui.colors

Source: turboframe/ui/colors.py. Generated from the code of TurboFrame 0.3.0 by tools/wiki_api.py.

Options > Colors: the colour theme, seen as it is chosen, and the colour depth.

Moving through the themes paints the whole desktop in them (the dialog too, and the application's sample below the list); OK keeps the one chosen, also for the next start (the store's palette), Cancel goes back to the one there was.

The colour depth is what the application sends to the terminal: automatic (what the terminal says it can: COLORTERM, TERM, the Windows console), or forced to true colour, 256 or 16 colours, for a terminal that says less than it can (over ssh or tmux COLORTERM is often lost). It is kept as the store's colors and applies from the next start.

An application mixes ColorsMixin into its Application, sets colors_store (an object with load() -> dict and save(dict): its config, its preferences) and may override colors_sample() with a widget showing its own text (an editor with code), then calls choose_colors() from a worker.

Contents

DETECTED, ColorsDialog, ColorsMixin, PickButtons, depth_setting

DETECTED

dict (4 entries)

class ColorsDialog

class ColorsDialog(TVDialog)
ColorsDialog(current: str, detected: str | None, *, depth: str = 'auto', sample: Widget | None = None)

The themes (each one previewed as it is chosen) and the colour depth. sample: a widget the themes paint (an editor with the application's code), shown under them.

  • valid(command: Command) -> bool

class ColorsMixin

class ColorsMixin

Options > Colors, mixed into the application.

  • colors_sample() -> Widget | None: A widget the themes paint in the dialog (an editor with the application's code); None: no sample.
  • async choose_colors() -> None: Run the dialog (from a worker); OK keeps the theme and the depth in colors_store.

class PickButtons

class PickButtons(RadioButtons)

Radio buttons that choose as the cursor moves, as Turbo Vision's (TRadioButtons::movedTo): each theme is seen the moment it is reached.

depth_setting

def depth_setting(store) -> str

The colour depth kept in store (auto when none, or none known).

Clone this wiki locally