Skip to content

Modern Tui TuiStyle

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

Home › Terminal TUI Library › Colour and Style › TuiStyle

TuiStyle

Holds a text style: colours, attributes such as bold, and which of them it sets.

Syntax

type TuiStyle
    as TuiColor fg, bg
    as uint16 attrs
    as uint16 mask
end type

Description

Foreground, background, attribute bits, and a MASK saying which of those this style actually sets. The mask is what makes Patch work: a style that sets only a foreground can be composed over another without erasing its background.

Example

#import "std/tui"
using tui

dim as TuiStyle s = TuiStyleOf( TuiRgb( 200, 200, 200 ), TuiRgb( 20, 20, 30 ), TUIATTR_BOLD )
print s.fg.r, s.bg.b              '' 200 30
print s.HasAttr( TUIATTR_BOLD )   '' true
print s.HasAttr( TUIATTR_ITALIC ) '' false

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