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

#include <ghostty/vt/style.h>

Data Fields

GhosttyStyleColor fg_color
GhosttyStyleColor bg_color
GhosttyStyleColor underline_color
GhosttyStyleFlags flags
uint16_t reserved

Detailed Description

Terminal cell style.

The complete visual style of a terminal cell: foreground, background, and underline colors, plus text attributes such as bold and the underline style.

The layout of this struct is fixed. It is 16 bytes on every platform and will not change in future versions, so it does not have a size field and does not need GHOSTTY_INIT_SIZED(). If a future version needs more style attributes, it will add a new type instead of changing this one.

Reserved bits are always zero in a style written by the library. This means two styles from the library can be compared with memcmp().

// Draw with a bold font.
}
if (GHOSTTY_STYLE_UNDERLINE(style) != GHOSTTY_SGR_UNDERLINE_NONE) {
// Draw an underline, colored by style.underline_color if it is set.
}
GHOSTTY_API GhosttyResult ghostty_render_state_row_cells_get(GhosttyRenderStateRowCells cells, GhosttyRenderStateRowCellsData data, void *out)
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_STYLE
Definition render.h:1005
#define GHOSTTY_STYLE_UNDERLINE(style)
Definition style.h:191
#define GHOSTTY_STYLE_FLAG_BOLD
Definition style.h:140
GhosttyStyleFlags flags
Definition style.h:238
Examples
c-vt-grid-traverse/src/main.c, c-vt-render/src/main.c, and c-vt-stream/src/main.c.

Definition at line 227 of file style.h.

Field Documentation

◆ bg_color

Background color.

Definition at line 232 of file style.h.

◆ fg_color

Foreground (text) color.

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

Definition at line 229 of file style.h.

◆ flags

Text attributes and underline style. See GhosttyStyleFlags.

Examples
c-vt-grid-traverse/src/main.c, c-vt-render/src/main.c, and c-vt-stream/src/main.c.

Definition at line 238 of file style.h.

◆ reserved

uint16_t reserved

Reserved for future use. Always zero.

Definition at line 241 of file style.h.

◆ underline_color

GhosttyStyleColor underline_color

Underline color.

Definition at line 235 of file style.h.


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