# `Color.CMYK`

Device CMYK color space. This is the simple "subtractive from sRGB"
device CMYK — it does NOT use an ICC profile, so it is not suitable
for color-accurate print workflows. For that, pass the sRGB (or
AdobeRGB) struct through a real CMS.

All channels are unit floats in `[0, 1]`.

# `t`

```elixir
@type t() :: %Color.CMYK{
  alpha: Color.Types.alpha(),
  c: float() | nil,
  k: float() | nil,
  m: float() | nil,
  y: float() | nil
}
```

A simple subtractive CMYK colour. Each of `c`, `m`, `y`, `k` is a
unit float in `[0.0, 1.0]`. No ICC profile is implied — this is
device-independent CMYK suitable for `device-cmyk()` interchange,
not for press output.

# `from_srgb`

Converts an sRGB color to CMYK.

### Arguments

* `srgb` is a `Color.SRGB` struct.

### Returns

* A `Color.CMYK` struct.

### Examples

    iex> {:ok, cmyk} = Color.CMYK.from_srgb(%Color.SRGB{r: 0.0, g: 0.0, b: 1.0})
    iex> {cmyk.c, cmyk.m, cmyk.y, cmyk.k}
    {1.0, 1.0, 0.0, 0.0}

# `from_xyz`

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

# `to_srgb`

Converts a CMYK color to sRGB.

### Arguments

* `cmyk` is a `Color.CMYK` struct.

### Returns

* A `Color.SRGB` struct.

### Examples

    iex> {:ok, srgb} = Color.CMYK.to_srgb(%Color.CMYK{c: 0.0, m: 0.0, y: 0.0, k: 0.0})
    iex> {srgb.r, srgb.g, srgb.b}
    {1.0, 1.0, 1.0}

    iex> {:ok, srgb} = Color.CMYK.to_srgb(%Color.CMYK{c: 1.0, m: 1.0, y: 0.0, k: 0.0})
    iex> {srgb.r, srgb.g, srgb.b}
    {0.0, 0.0, 1.0}

# `to_xyz`

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

---

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