# `Color.HPLuv`

HPLuv — the "pastel" sibling of HSLuv.

Where HSLuv lets `S = 100` reach the full sRGB gamut boundary (which
gives different chromas at different hues), HPLuv rescales so that
`S = 100` is the largest chroma achievable at the given `L` at ALL
hues. This means HPLuv cannot represent the most saturated sRGB
colours at any given lightness, but any `HPLuv(h, 100, l)` triple is
achromatically consistent across hues — useful for "pastel" palettes.

Reference: https://www.hsluv.org/ (Alexei Boronine).

# `t`

```elixir
@type t() :: %Color.HPLuv{
  alpha: Color.Types.alpha(),
  h: float() | nil,
  l: float() | nil,
  s: float() | nil
}
```

An HPLuv colour. Like HSLuv but with the chroma component clipped
to the largest pastel-friendly chroma at the given lightness.
Hue in degrees `[0.0, 360.0)`, saturation and lightness as
percentages `[0.0, 100.0]`.

# `from_lchuv`

Converts an `LCHuv` color to HPLuv.

# `from_xyz`

Converts a CIE `XYZ` color to HPLuv via `LCHuv`.

# `to_lchuv`

Converts an HPLuv color to `LCHuv`.

### Arguments

* `hpluv` is a `Color.HPLuv` struct.

### Returns

* A `Color.LCHuv` struct.

### Examples

    iex> {:ok, lch} = Color.HPLuv.to_lchuv(%Color.HPLuv{h: 0.0, s: 0.0, l: 50.0})
    iex> {Float.round(lch.l, 2), Float.round(lch.c, 2)}
    {50.0, 0.0}

# `to_xyz`

Converts an HPLuv color to CIE `XYZ` via `LCHuv`.

---

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