# `Drafter.Prompt.Style`
[🔗](https://github.com/jaman/drafter/blob/v0.6.0/lib/drafter/prompt/style.ex#L1)

The colours and symbols prompts are drawn with.

`current/1` reads the colours from the active `Drafter.Theme` and the symbols from
the active skin: `:ascii` gives 7-bit symbols, every other skin gives Unicode ones.
Colours are left out when the `NO_COLOR` environment variable is set to anything
but the empty string.

    style = Drafter.Prompt.Style.current()
    Drafter.Prompt.Style.segment(style, :accent, "?")

## Roles

`segment/3` styles text by role: `:plain`, `:strong`, `:accent`, `:success`,
`:error`, `:warning` and `:muted`.

## Symbols

`symbol/2` looks up `:question`, `:done`, `:failed`, `:pointer`, `:on`, `:off`,
`:prompt`, `:separator`, `:info`, `:warning`, `:bar_full` and `:bar_empty`.
`spinner/2` gives the spinner's symbol for a tick count.

# `role`

```elixir
@type role() :: :plain | :strong | :accent | :success | :error | :warning | :muted
```

# `t`

```elixir
@type t() :: %Drafter.Prompt.Style{
  accent: Drafter.Draw.Segment.color(),
  color: boolean(),
  error: Drafter.Draw.Segment.color(),
  muted: Drafter.Draw.Segment.color(),
  spinner: [String.t()],
  success: Drafter.Draw.Segment.color(),
  symbols: %{required(atom()) =&gt; String.t()},
  warning: Drafter.Draw.Segment.color()
}
```

# `current`

```elixir
@spec current(keyword()) :: t()
```

The style for the calling process.

`overrides` replaces fields of the result: `:accent`, `:success`, `:error`,
`:warning` and `:muted` take `{r, g, b}` colours, `:symbols` a map merged over the
built-in symbols, `:spinner` a list of symbols, and `:color` a boolean.

# `segment`

```elixir
@spec segment(t(), role(), String.t()) :: Drafter.Draw.Segment.t()
```

`text` styled for `role`.

# `spinner`

```elixir
@spec spinner(t(), non_neg_integer()) :: String.t()
```

The spinner's symbol at `tick`, cycling through the spinner's symbols.

# `symbol`

```elixir
@spec symbol(t(), atom()) :: String.t()
```

The symbol named `name`.

---

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