libghostty-vt 0.0.0
Loading...
Searching...
No Matches
GhosttyStyleColor Struct Reference

#include <ghostty/vt/style.h>

Data Fields

uint8_t tag
GhosttyStyleColorValue value

Detailed Description

Style color.

A color used by a style. It is either unset, an index into the terminal palette, or a direct RGB value. The struct is four bytes: a one-byte tag followed by the three-byte value.

An unset color means the style does not choose a color. Use the terminal's default color for that slot instead.

switch (style.fg_color.tag) {
case GHOSTTY_STYLE_COLOR_NONE:
// Use the terminal's default foreground color.
break;
case GHOSTTY_STYLE_COLOR_PALETTE:
// Look up style.fg_color.value.palette in the palette.
break;
case GHOSTTY_STYLE_COLOR_RGB:
// Use style.fg_color.value.rgb directly.
break;
}
Examples
c-vt-render/src/main.c.

Definition at line 113 of file style.h.

Field Documentation

◆ tag

uint8_t tag

The kind of color. One of the GhosttyStyleColorTag values.

Examples
c-vt-render/src/main.c.

Definition at line 115 of file style.h.

◆ value

The color data. Which field is valid depends on tag.

Examples
c-vt-render/src/main.c.

Definition at line 118 of file style.h.


The documentation for this struct was generated from the following file: