# `ExcessibilityStorybook.Color`
[🔗](https://github.com/lessthanseventy/excessibility_storybook/blob/v0.1.0/lib/excessibility_storybook/color.ex#L1)

CSS color parsing and contrast math.

Colors are `{r, g, b}` tuples of gamma-encoded sRGB in `0.0..1.0`. Out-of-gamut
oklch values are clipped per channel, which is what browsers do too.

# `rgb`

```elixir
@type rgb() :: {float(), float(), float()}
```

# `apca_lc`

```elixir
@spec apca_lc(rgb(), rgb()) :: float()
```

APCA lightness contrast (Lc), apca-w3 0.0.98G-4g. Order matters: text first.
Positive is dark text on light, negative is light text on dark.

# `parse`

```elixir
@spec parse(String.t()) :: {:ok, rgb()} | :error
```

# `wcag_ratio`

```elixir
@spec wcag_ratio(rgb(), rgb()) :: float()
```

WCAG 2.x contrast ratio, 1.0..21.0. Order doesn't matter.

---

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