# `AshWorkflow.Charts.Palette`
[🔗](https://github.com/team-alembic/ash_workflow/blob/v0.12.0/lib/ash_workflow/charts/palette.ex#L1)

The colours of the charts that `AshWorkflow.Charts.Dot` draws, for each
theme. A backend that draws in colour reads them here, so every such chart
has the same look.

The palette has one class for each step kind, terminal outcome and edge
kind.

`:light` is for a light page. `:dark` is for a dark page, with deep fills,
light strokes and light text.

# `class`

```elixir
@type class() ::
  :automatic
  | :manual
  | :wait_state
  | :done
  | :failed
  | :expired
  | :end
  | :on_success
  | :on_error
  | :timeout
  | :undo
```

# `theme`

```elixir
@type theme() :: :light | :dark
```

# `background`

```elixir
@spec background(theme()) :: String.t()
```

The background colour of a chart, for a theme.

# `colours`

```elixir
@spec colours(theme()) :: keyword(keyword(String.t()))
```

The colours of each class, for a theme: a keyword list from the class name
to its colours. The classes are in this order:

* `:automatic`, `:manual` and `:wait_state`, for the step kinds.
* `:done`, `:failed`, `:expired` and `:end`, for terminal steps.
* `:on_success`, `:on_error`, `:timeout` and `:undo`, for edges.

A step class has `:fill` and `:stroke`, and an edge class has `:stroke`.
In the dark theme a step class also has `:text`, the colour of its label.

# `edge_label_colour`

```elixir
@spec edge_label_colour(theme()) :: String.t()
```

The colour of the edge label text, for a theme.

# `terminal_class`

```elixir
@spec terminal_class(atom(), AshWorkflow.Charts.Graph.t()) ::
  :done | :failed | :expired | :end
```

The class of a terminal step, from the kinds of the edges that reach it:
`:failed` for `on_error` only, `:expired` for timeouts only, `:done` for
transitions, `on_signal` and `on_success` only, and `:end` for a mix or for no edge.

Undo edges leave a step and do not count. A step that a person chooses is
`:done`, whatever its name.

---

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