# `Color.IPT`

IPT perceptual color space (Ebner & Fairchild, 1998).

IPT is a Lab-like opponent color space built on D65 and a simple
non-linearity (`|x|^0.43`). It is the conceptual ancestor of Oklab
and JzAzBz and is still used for gamut-mapping work because of its
well-behaved hue linearity.

# `t`

```elixir
@type t() :: %Color.IPT{
  alpha: Color.Types.alpha(),
  i: float() | nil,
  p: float() | nil,
  t: float() | nil
}
```

An IPT colour (Ebner & Fairchild 1998), the Oklab predecessor.
Components `i` (intensity), `p` (protan-red/green) and `t`
(tritan-yellow/blue) are unit-range floats.

# `from_xyz`

Converts CIE `XYZ` (D65, `Y ∈ [0, 1]`) to IPT.

### Arguments

* `xyz` is a `Color.XYZ` struct.

### Returns

* A `Color.IPT` struct.

### Examples

    iex> {:ok, ipt} = Color.IPT.from_xyz(%Color.XYZ{x: 0.95047, y: 1.0, z: 1.08883, illuminant: :D65, observer_angle: 2})
    iex> {Float.round(ipt.i, 3), abs(ipt.p) < 1.0e-3, abs(ipt.t) < 1.0e-3}
    {1.0, true, true}

# `to_xyz`

Converts IPT to CIE `XYZ` (D65, `Y ∈ [0, 1]`).

---

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