# `Cardbox.Choice`
[🔗](https://github.com/hattoriai/cardbox/blob/v0.1.0/lib/cardbox/choice.ex#L1)

The choices of a select, a multi-select or a status field: each an `id`,
a `name` and a `color`, and for a status a `group`.

    %{"id" => "in_review", "name" => "In review", "color" => "purple", "group" => "doing"}

A record keeps a choice's `id`, so a choice renamed or recolored is
renamed everywhere at once, and a choice removed from the field is
removed from the records that had it.

The colors are Erabi's nine (`gray`, `brown`, `orange`, `yellow`,
`green`, `blue`, `purple`, `pink`, `red`), which its pickers draw with
their contrast checked in light and dark; `to_options/1` gives the
choices as Erabi takes them.

A status's groups are `"todo"`, `"doing"` and `"done"`, in that order:
a board of a status field shows them, and a filter takes a whole group
(`in_group`).

# `colors`

```elixir
@spec colors() :: [String.t()]
```

The colors a choice takes.

# `find`

```elixir
@spec find([map()], term()) :: map() | nil
```

The choice of a list with this id, or with this name (without case), or nil.

# `groups`

```elixir
@spec groups() :: [String.t()]
```

The groups of a status's choices, in their order.

# `to_options`

```elixir
@spec to_options([map()]) :: [map()]
```

The choices as Erabi's options (`Erabi.Option`): `value` the id, `label`
the name, `color` the color as an atom, and a status's group as `group`.

---

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