Skip to content

Modern Tui TuiStyleOf

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

Home › Terminal TUI Library › Colour and Style › TuiStyleOf

TuiStyleOf

Returns a style with a foreground, a background and optional attributes.

Syntax

TuiStyleOf( byval fg as TuiColor, byval bg as TuiColor, byval attrs as uint16 = TUIATTR_NONE ) as TuiStyle

Description

Builds a style that sets all three things. For a style that sets only some of them -- so that Patch leaves the rest alone -- use TuiStylePatch.

Example

#import "std/tui"
using tui

dim as TuiStyle s = TuiStyleOf( TuiRgb( 235, 80, 80 ), TuiDefaultColor( ), TUIATTR_BOLD )
print s.fg.r, s.bg.IsDefault( ), s.HasAttr( TUIATTR_BOLD )   '' 235 true true

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