Repository navigation
API 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.
DETECTED, ColorsDialog, ColorsMixin, PickButtons, depth_setting
dict (4 entries)
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 ColorsMixinOptions > 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 incolors_store.
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.
def depth_setting(store) -> strThe colour depth kept in store (auto when none, or none known).
TurboFrame · part of Divengine · GPL-3.0-or-later · report an issue
Tutorial
Examples
The desktop
- The Desktop
- Application Mixins
- Windows and Lists
- Dialogs
- Histories
- Progress
- Themes and Colors
- Glyphs
- Settings and Recent Files
- Command Palette
Editing
Tasks
Languages
Running
Reference
Links