# `Localize.Message.Formatter.ANSI`
[🔗](https://github.com/elixir-localize/localize/blob/v0.39.0/lib/localize/message/formatter/ansi.ex#L1)

ANSI terminal formatter for MF2 highlight tokens.

Wraps each token in ANSI colour escape codes suitable for IEx
output, `mix` task messages, or anywhere a terminal is assumed.
Colours are chosen for legibility on both light and dark
backgrounds using ANSI 4-bit colours only (no truecolor).

# `options`

```elixir
@type options() :: [
  {:palette, %{required(Localize.Message.Highlighter.class()) =&gt; [atom()]}}
]
```

# `render`

```elixir
@spec render([Localize.Message.Highlighter.token()], options()) :: String.t()
```

Renders a token list as an ANSI-coloured string.

### Arguments

* `tokens` is a list of `t:Highlighter.token/0` tuples.

* `options` is a keyword list.

### Options

* `:palette` — a map `%{class => [ansi_atom]}` overriding the
  default colour for specific classes.

### Returns

* A string containing ANSI escape codes.

---

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