Skip to content

terminal/theme

import { … } from 'zidane-ui/terminal'ui/src/terminal/theme.ts

Functions#

solidFunction#

color as an opaque #rrggbb, composited over under when it has alpha.

TypeScript
function solid(color: string, under: string): string
Parameters
NameTypeDescription
colorstring

Any CSS colour parseColor reads; unreadable falls back to under (or black).

understring

The colour beneath, usually the terminal background.

string

ui/src/terminal/theme.ts:64

terminalThemeFunction#

Maps a resolved palette to terminal colors, every one opaque over the palette background (see the module comment for the ANSI mapping).

TypeScript
function terminalTheme(p: ResolvedPalette): TerminalTheme
Parameters
NameTypeDescription
pResolvedPalette

The resolved palette of the current theme.

ui/src/terminal/theme.ts:79

Interfaces#

TerminalThemeInterface#

Same shape as ghostty-web's ITheme (kept here so this stays import-free of the package).

TypeScript
interface TerminalTheme
TerminalTheme properties
NameTypeDescription
backgroundstring

The terminal background: the palette background, opaque.

blackstring

ANSI 0: the darkest surface on dark themes, the text colour on light ones.

bluestring

ANSI 4: the info token.

brightBlackstring

ANSI 8: subtle text (dim output, comments).

brightBluestring

ANSI 12: info, mixed 30% toward the text.

brightCyanstring

ANSI 14: cyan, mixed 30% toward the text.

brightGreenstring

ANSI 10: success, mixed 30% toward the text.

brightMagentastring

ANSI 13: the secondary accent, mixed 30% toward the text.

brightRedstring

ANSI 9: danger, mixed 30% toward the text.

brightWhitestring

ANSI 15: the text on dark themes, muted text on light ones.

brightYellowstring

ANSI 11: warn, mixed 30% toward the text.

cursorstring

Cursor block: the accent.

cursorAccentstring

Text under the cursor: the background.

cyanstring

ANSI 6: halfway between info and success.

foregroundstring

Default text: the palette text.

greenstring

ANSI 2: the success token.

magentastring

ANSI 5: the secondary accent.

redstring

ANSI 1: the danger token.

selectionBackgroundstring

Selection fill: the palette selection.

selectionForegroundstring

Selected text: the palette text.

whitestring

ANSI 7: muted text on dark themes, subtle text on light ones.

yellowstring

ANSI 3: the warn token.

ui/src/terminal/theme.ts:11