struct

ArrTop::Theme

Inherits Struct < Value < Object

The TUI colour scheme: a bag of ANSI escape codes plus an enabled flag and one #colorize helper. Everything the renderer draws pulls its colour from a Theme, so a single place decides "what does an importing row look like" and whether colour is emitted at all.

FUTURE: the theme is meant to be user-configurable (exposed via Config) so a user can override any of these codes. For now that wiring does not exist — the whole app uses Theme.default (a TTY with colour) or Theme.disabled (piped/NO_COLOR). When config support lands, add a Theme.from_config that overlays user codes on top of default; nothing else here needs to change.

Colours are 256-colour escapes (\e[38;5;Nm) where a specific light tone is wanted, and plain SGR codes (\e[3Xm) otherwise. A code may be the empty string, which means "no colour" (Queued reads in the terminal's default foreground); #colorize passes such text through untouched.

Constants

RESET = "\e[0m"

The SGR reset that ends every colourised span.

Constructors

default

The default palette with colour on (for an interactive TTY).

Source
detect(*, tty : Bool) : Theme

The right theme for an output stream: the default palette, enabled only when tty is true and NO_COLOR is unset in the environment. This is the single gate that keeps ANSI out of non-terminal output.

Source
disabled

The default palette with colour off — for piped/--once/NO_COLOR output and for pure width-accounting in specs (plain glyphs, no ANSI).

Source
new(*, bar_filled : String, bar_remaining : String, brackets : String, bar_filled_glyph : String, bar_empty_glyph : String, status_importing : String, status_pending : String, status_downloading : String, status_failed : String, status_queued : String, status_unknown : String, border : String, header_label : String, title : String, speed : String, enabled : Bool)
Source

Instance methods

bar_empty_glyph
Source
bar_filled

Progress-bar filled cell — light blue.

Source
bar_filled_glyph

Progress-bar cell glyphs. Both default to (U+2588 FULL BLOCK) so the bar is a solid two-tone run distinguished only by colour — the most font-portable choice. They are separate fields so the empty cell can later be switched to a shade glyph (/) in one place; the bar renderer reads the glyphs from here rather than hardcoding them.

Source
bar_remaining

Progress-bar remaining cell — light grey.

Source
border

Box border/corner colour — dim grey.

Source
brackets

Progress-bar [/] brackets — dark grey.

Source
colorize(text : String, code : String) : String

Wraps text in code + RESET when colour is enabled and code is non-empty; otherwise returns text unchanged. Because it only ever adds escape sequences around the text, the visible width is never altered — callers can lay out on plain text and colourise afterward.

Source
enabled?

Whether colour is emitted at all. When false every #colorize call returns its text bare, so no ANSI leaks into a pipe, a file, or a NO_COLOR session.

Source
header_label

Column-header label colour — bold.

Source
speed

Aggregated transfer-speed readout — green.

Source
status_code(row : QueueRow, state : State = row.state) : String

The status-label colour code for row: any warning/error row (or the Failed state) is red, overriding the per-state colour; otherwise the colour follows the normalized State. state defaults to row.state but may be the reclassified display state (e.g. a season-pack row shown pending).

Source
status_downloading
Source
status_failed
Source
status_importing

Status label colours, keyed by meaning.

Source
status_pending
Source
status_queued
Source
status_unknown
Source
title

App title in the top border — bold.

Source