Skip to content

Modern Tui TuiTheme

Paul Squires edited this page Oct 19, 2026 · 6 revisions

Home › Terminal TUI Library › Colour and Style › TuiTheme

TuiTheme

Holds twelve named styles, such as normal, accent, selected and danger.

Syntax

type TuiTheme
    as TuiStyle normal, dim_, accent, selected, disabled
    as TuiStyle border, borderFocused, title
    as TuiStyle success, warning, danger, info
end type

Description

Twelve named styles. There is NO ambient theme singleton -- you hold a theme and pass it where it is needed, which is what lets two panels in one program look different without a global to fight over. dim_ has the underscore because DIM is a statement.

Example

#import "std/tui"
using tui

dim as TuiTheme th = TuiThemeDefault( )
print th.accent.fg.IsDefault( )        '' false -- the accent picks a colour
print th.accent.fg.Index( )            '' 14 -- bright cyan
print th.danger.fg.Index( )            '' 9  -- bright red

'' The stock theme is built from ANSI16 entries on purpose, so it honours a
'' user's terminal palette. Read Index( ), not .r -- see TuiColor.

'' a theme is a value: copy it and change one entry
dim as TuiTheme mine = th
mine.accent = TuiStyleOf( TuiRgb( 250, 180, 60 ), TuiDefaultColor( ), TUIATTR_BOLD )

See also

TuiColor TuiColor.Equals TuiDefaultColor TuiIndexed TuiBlack TuiGreen
TuiColor.IsDefault TuiColor.Index TuiAnsi TuiRgb TuiRed TuiYellow

Library: Terminal TUI Library
Category: Terminal TUI Library
Documented under: Colour and Style
Working examples: hello.tiko · form.tiko · dashboard.tiko


Home · Keyword Index

Clone this wiki locally