# `Atui.Style`
[🔗](https://github.com/iboard/atui/blob/v0.3.0/lib/atui/style.ex#L1)

Colour and text attributes for a cell.

A style is data, not escape codes: views build `%Atui.Style{}` structs and the
screen turns runs of equally-styled cells into SGR sequences when it renders.
That keeps views comparable — two frames differ when their *styles* differ,
not when someone reordered the escape codes.

    Style.new(fg: :bright_cyan, bold: true)
    Style.new(fg: 208, bg: :black)            # 256-colour palette
    Style.new(fg: {:rgb, 255, 128, 0})        # truecolor

Colours are a named colour (`:red`, `:bright_red`, …), an integer `0..255`
from the 256-colour palette, or `{:rgb, r, g, b}`.

# `color`

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

# `t`

```elixir
@type t() :: %Atui.Style{
  bg: color(),
  bold: boolean(),
  dim: boolean(),
  fg: color(),
  italic: boolean(),
  reverse: boolean(),
  underline: boolean()
}
```

# `default`

The terminal's own colours and attributes — renders as no escape codes.

# `default?`

True when the style asks for nothing (`nil` counts as default).

# `new`

Builds a style; see the module docs for the accepted colours.

# `reset`

The sequence returning the terminal to its default style.

# `to_ansi`

The SGR sequence that turns this style on, or `""` for the default.

# `transition`

The escape codes to move from `previous` to `next`.

Styles are absolute rather than incremental, so any change resets first —
a cell's appearance never depends on what was drawn before it.

---

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