# `Color.HSV`

HSV color space — hue, saturation, value.

All channels are unit floats in `[0, 1]`. HSV is a non-linear
reparameterisation of sRGB, so conversions to any CIE space route
through `Color.SRGB`.

# `t`

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

A non-linear HSV reparameterisation of sRGB. All three components
are unit floats in `[0.0, 1.0]`. Hue is one full turn over `[0,
1]`.

# `from_srgb`

Converts an sRGB color to HSV.

### Arguments

* `srgb` is a `Color.SRGB` struct with unit-range channels.

### Returns

* A `Color.HSV` struct.

### Examples

    iex> {:ok, hsv} = Color.HSV.from_srgb(%Color.SRGB{r: 1.0, g: 0.0, b: 0.0})
    iex> {hsv.h, hsv.s, hsv.v}
    {0.0, 1.0, 1.0}

# `from_xyz`

Converts a CIE `XYZ` color to HSV via sRGB.

# `to_srgb`

Converts an HSV color to sRGB.

### Arguments

* `hsv` is a `Color.HSV` struct.

### Returns

* A `Color.SRGB` struct with unit-range channels.

### Examples

    iex> {:ok, srgb} = Color.HSV.to_srgb(%Color.HSV{h: 0.0, s: 1.0, v: 1.0})
    iex> {srgb.r, srgb.g, srgb.b}
    {1.0, 0.0, 0.0}

# `to_xyz`

Converts an HSV color to CIE `XYZ` via sRGB.

---

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