Skip to content

Style

Defined in: src/render/style.ts:36

An immutable per-cell visual style. Build one and pass it to ScreenBuffer.setCell.

new Style(props?): Style

Defined in: src/render/style.ts:60

StyleProps = {}

Style

readonly optional background?: string

Defined in: src/render/style.ts:40

Background color.


readonly bold: boolean

Defined in: src/render/style.ts:42

Bold/bright.


readonly optional color?: string

Defined in: src/render/style.ts:38

Foreground color.


readonly dim: boolean

Defined in: src/render/style.ts:54

Reduced intensity.


readonly italic: boolean

Defined in: src/render/style.ts:44

Italic.


readonly optional link?: string

Defined in: src/render/style.ts:58

Hyperlink target.


readonly reverse: boolean

Defined in: src/render/style.ts:52

Foreground/background swapped.


readonly strikethrough: boolean

Defined in: src/render/style.ts:56

Struck-through.


readonly underline: boolean

Defined in: src/render/style.ts:46

Underlined.


readonly optional underlineColor?: string

Defined in: src/render/style.ts:50

Underline color (independent of foreground).


readonly optional underlineStyle?: UnderlineStyle

Defined in: src/render/style.ts:48

Underline shape.


readonly static DEFAULT: Style

Defined in: src/render/style.ts:75

The empty style (terminal defaults).

equals(other): boolean

Defined in: src/render/style.ts:78

True if every attribute matches.

Style

boolean


matchesProps(props): boolean

Defined in: src/render/style.ts:104

Whether this style’s resolved fields equal props as the constructor would normalise them — booleans coerced (!!), underline implied by underlineStyle. Lets StyleCache match a request against a cached instance without allocating a throwaway Style to compare.

StyleProps

boolean


merge(other): Style

Defined in: src/render/style.ts:121

Return a new Style with other’s defined attributes layered over this one.

StyleProps | Style

Style