# `Ghostty.Terminal.Cell`
[🔗](https://github.com/dannote/ghostty_ex/blob/v0.5.0/lib/ghostty/terminal/cell.ex#L1)

Helpers for working with terminal cell tuples.

Each cell is `{grapheme, fg, bg, flags}` where:

  * `grapheme` — UTF-8 binary (empty for blank cells)
  * `fg` / `bg` — `{r, g, b}` tuples or `nil`
  * `flags` — bitmask of style attributes

## Flag bits

| Bit | Attribute     |
|-----|---------------|
| 0   | bold          |
| 1   | italic        |
| 2   | faint         |
| 3   | underline     |
| 4   | strikethrough |
| 5   | inverse       |
| 6   | blink         |
| 7   | overline      |

# `color`

```elixir
@type color() :: {0..255, 0..255, 0..255} | nil
```

# `t`

```elixir
@type t() :: {binary(), color(), color(), non_neg_integer()}
```

# `bg`

```elixir
@spec bg(t()) :: color()
```

Returns the background color or `nil`.

# `blank?`

```elixir
@spec blank?(t()) :: boolean()
```

Returns `true` if the cell is blank (empty grapheme, no styling).

# `blink?`

```elixir
@spec blink?(t()) :: boolean()
```

# `bold?`

```elixir
@spec bold?(t()) :: boolean()
```

# `faint?`

```elixir
@spec faint?(t()) :: boolean()
```

# `fg`

```elixir
@spec fg(t()) :: color()
```

Returns the foreground color or `nil`.

# `flags`

```elixir
@spec flags(t()) :: non_neg_integer()
```

Returns the raw flags bitmask.

# `grapheme`

```elixir
@spec grapheme(t()) :: binary()
```

Returns the grapheme string.

# `inverse?`

```elixir
@spec inverse?(t()) :: boolean()
```

# `italic?`

```elixir
@spec italic?(t()) :: boolean()
```

# `overline?`

```elixir
@spec overline?(t()) :: boolean()
```

# `strikethrough?`

```elixir
@spec strikethrough?(t()) :: boolean()
```

# `underline?`

```elixir
@spec underline?(t()) :: boolean()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
