# `Pote.ColorInfo`
[🔗](https://github.com/Lorenzo-SF/pote/blob/2.2.0/lib/pote/color_info.ex#L1)

Structured representation of a color in all supported formats.

`Pote.ColorInfo` holds a color's values across multiple color spaces
(RGB, HEX, HSL, HSV, CMYK, XTerm256, ARGB) and provides convenient
methods for harmonies, lightness adjustments, and ANSI output.

Create a `ColorInfo` from any valid color input using `new/1`.

## Examples

    iex> ci = Pote.ColorInfo.new("#FF8000")
    iex> ci.rgb
    {255, 128, 0}
    iex> ci.hex
    "#FF8000"

# `argb`

```elixir
@type argb() :: {0..255, 0..255, 0..255, 0..255}
```

# `cmyk`

```elixir
@type cmyk() :: {number(), number(), number(), number()}
```

# `hsl`

```elixir
@type hsl() :: {number(), number(), number()}
```

# `hsv`

```elixir
@type hsv() :: {number(), number(), number()}
```

# `rgb`

```elixir
@type rgb() :: {0..255, 0..255, 0..255}
```

# `t`

```elixir
@type t() :: %Pote.ColorInfo{
  argb: argb() | nil,
  cmyk: cmyk() | nil,
  display: any() | nil,
  format: atom() | nil,
  hex: String.t() | nil,
  hsl: hsl() | nil,
  hsv: hsv() | nil,
  inverted: boolean(),
  name: atom() | nil,
  rgb: rgb() | nil,
  xterm256: 0..255 | nil
}
```

# `analogous`

```elixir
@spec analogous(t(), number()) :: [t()]
```

Returns two analogous colors (offset by angle degrees).

# `basic_colors`

```elixir
@spec basic_colors() :: %{required(atom()) =&gt; {0..255, 0..255, 0..255}}
```

Returns the map of basic ANSI colors.

# `complementary`

```elixir
@spec complementary(t()) :: t()
```

Returns the complementary color (180 opposite on the wheel).

# `darker`

```elixir
@spec darker(t(), number()) :: t()
```

Returns a darker variant of the color blended with black.

# `lighter`

```elixir
@spec lighter(t(), number()) :: t()
```

Returns a lighter variant of the color blended with white.

# `nearest_basic_color`

```elixir
@spec nearest_basic_color(rgb()) :: atom()
```

Finds the nearest basic ANSI color name for a given RGB value.

## Examples

    iex> Pote.ColorInfo.nearest_basic_color({255, 0, 0})
    :red

    iex> Pote.ColorInfo.nearest_basic_color({250, 10, 5})
    :red

# `new`

```elixir
@spec new() :: t()
```

Creates a new empty ColorInfo structure.

# `new`

```elixir
@spec new(
  any(),
  keyword()
) :: t()
```

Creates a new ColorInfo from various inputs.

# `to_ansi`

```elixir
@spec to_ansi(t()) :: String.t()
```

Converts ColorInfo to ANSI escape code.

# `triad`

```elixir
@spec triad(t()) :: [t()]
```

Returns the triad harmony (base + 120 + 240).

---

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