# terminal/theme (zidane-ui/terminal)

Import: `import { … } from 'zidane-ui/terminal'`. Source: [ui/src/terminal/theme.ts](https://github.com/Tahul/zidane/blob/main/ui/src/terminal/theme.ts).

## Functions

### `solid`

Function.

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

```ts
function solid(color: string, under: string): string
```

**Parameters**

- `color` (`string`): Any CSS colour `parseColor` reads; unreadable falls back to `under` (or black).
- `under` (`string`): The colour beneath, usually the terminal background.

**Returns** `string`

Source: [ui/src/terminal/theme.ts:64](https://github.com/Tahul/zidane/blob/main/ui/src/terminal/theme.ts#L64)

### `terminalTheme`

Function.

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

```ts
function terminalTheme(p: ResolvedPalette): TerminalTheme
```

**Parameters**

- `p` (`ResolvedPalette`): The resolved palette of the current theme.

**Returns** `TerminalTheme`

Source: [ui/src/terminal/theme.ts:79](https://github.com/Tahul/zidane/blob/main/ui/src/terminal/theme.ts#L79)

## Interfaces

### `TerminalTheme`

Interface.

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

```ts
interface TerminalTheme
```

**Properties**

- `background` (`string`): The terminal background: the palette background, opaque.
- `black` (`string`): ANSI 0: the darkest surface on dark themes, the text colour on light ones.
- `blue` (`string`): ANSI 4: the info token.
- `brightBlack` (`string`): ANSI 8: subtle text (dim output, comments).
- `brightBlue` (`string`): ANSI 12: info, mixed 30% toward the text.
- `brightCyan` (`string`): ANSI 14: cyan, mixed 30% toward the text.
- `brightGreen` (`string`): ANSI 10: success, mixed 30% toward the text.
- `brightMagenta` (`string`): ANSI 13: the secondary accent, mixed 30% toward the text.
- `brightRed` (`string`): ANSI 9: danger, mixed 30% toward the text.
- `brightWhite` (`string`): ANSI 15: the text on dark themes, muted text on light ones.
- `brightYellow` (`string`): ANSI 11: warn, mixed 30% toward the text.
- `cursor` (`string`): Cursor block: the accent.
- `cursorAccent` (`string`): Text under the cursor: the background.
- `cyan` (`string`): ANSI 6: halfway between info and success.
- `foreground` (`string`): Default text: the palette text.
- `green` (`string`): ANSI 2: the success token.
- `magenta` (`string`): ANSI 5: the secondary accent.
- `red` (`string`): ANSI 1: the danger token.
- `selectionBackground` (`string`): Selection fill: the palette selection.
- `selectionForeground` (`string`): Selected text: the palette text.
- `white` (`string`): ANSI 7: muted text on dark themes, subtle text on light ones.
- `yellow` (`string`): ANSI 3: the warn token.

Source: [ui/src/terminal/theme.ts:11](https://github.com/Tahul/zidane/blob/main/ui/src/terminal/theme.ts#L11)
