# `AtomLGFX.Color`
[🔗](https://github.com/mnishiguchi/atomlgfx/blob/v0.1.0/lib/atom_lgfx/color.ex#L5)

AtomLGFX の色値を扱うための補助関数群です。

# `display_descriptor`

```elixir
@type display_descriptor() :: {:rgb565, rgb565_value()}
```

# `index_descriptor`

```elixir
@type index_descriptor() :: {:index, palette_index_value()}
```

# `palette_descriptor`

```elixir
@type palette_descriptor() :: {:rgb888, rgb888_value()}
```

# `palette_index_value`

```elixir
@type palette_index_value() :: 0..255
```

# `rgb332_value`

```elixir
@type rgb332_value() :: 0..255
```

# `rgb565_value`

```elixir
@type rgb565_value() :: 0..65535
```

# `rgb888_value`

```elixir
@type rgb888_value() :: 0..16_777_215
```

# `black`

```elixir
@spec black() :: rgb565_value()
```

RGB565 の黒色です。

# `blue`

```elixir
@spec blue() :: rgb565_value()
```

RGB565 の青色です。

# `brown`

```elixir
@spec brown() :: rgb565_value()
```

RGB565 の茶色です。

# `color8to16`

```elixir
@spec color8to16(rgb332_value()) :: rgb565_value()
```

RGB332 を RGB565 へ変換します。

# `color16to8`

```elixir
@spec color16to8(rgb565_value()) :: rgb332_value()
```

RGB565 を RGB332 へ変換します。

# `color16to24`

```elixir
@spec color16to24(rgb565_value()) :: rgb888_value()
```

RGB565 を圧縮 RGB888 へ変換します。

# `color24to16`

```elixir
@spec color24to16(rgb888_value()) :: rgb565_value()
```

圧縮 RGB888 を RGB565 へ変換します。

# `color332`

```elixir
@spec color332(0..255, 0..255, 0..255) :: rgb332_value()
```

8ビットの RGB 各成分を RGB332 色へまとめます。

# `color565`

```elixir
@spec color565(0..255, 0..255, 0..255) :: rgb565_value()
```

8ビットの RGB 各成分を RGB565 色へまとめます。

# `color888`

```elixir
@spec color888(0..255, 0..255, 0..255) :: rgb888_value()
```

8ビットの RGB 各成分を圧縮 RGB888 色へまとめます。

# `cyan`

```elixir
@spec cyan() :: rgb565_value()
```

RGB565 のシアン色です。

# `dark_cyan`

```elixir
@spec dark_cyan() :: rgb565_value()
```

RGB565 の濃いシアン色です。

# `dark_gray`

```elixir
@spec dark_gray() :: rgb565_value()
```

`dark_grey/0` の別名です。

# `dark_green`

```elixir
@spec dark_green() :: rgb565_value()
```

RGB565 の濃い緑色です。

# `dark_grey`

```elixir
@spec dark_grey() :: rgb565_value()
```

RGB565 の濃い灰色です。

# `display`

```elixir
@spec display(rgb565_value()) :: display_descriptor()
```

RGB565 表示色を `{:rgb565, value}` として明示します。

# `gold`

```elixir
@spec gold() :: rgb565_value()
```

RGB565 の金色です。

# `green`

```elixir
@spec green() :: rgb565_value()
```

RGB565 の緑色です。

# `green_yellow`

```elixir
@spec green_yellow() :: rgb565_value()
```

RGB565 の黄緑色です。

# `index`

```elixir
@spec index(palette_index_value()) :: index_descriptor()
```

配色表番号を `{:index, value}` として明示します。

# `light_gray`

```elixir
@spec light_gray() :: rgb565_value()
```

`light_grey/0` の別名です。

# `light_grey`

```elixir
@spec light_grey() :: rgb565_value()
```

RGB565 の薄い灰色です。

# `magenta`

```elixir
@spec magenta() :: rgb565_value()
```

RGB565 のマゼンタ色です。

# `maroon`

```elixir
@spec maroon() :: rgb565_value()
```

RGB565 のえび茶色です。

# `named_rgb565`

```elixir
@spec named_rgb565(atom()) :: {:ok, rgb565_value()} | {:error, term()}
```

名前付き色に対応する RGB565 値を返します。

# `named_rgb888`

```elixir
@spec named_rgb888(atom()) :: {:ok, rgb888_value()} | {:error, term()}
```

名前付き色に対応する圧縮 RGB888 値を返します。

# `navy`

```elixir
@spec navy() :: rgb565_value()
```

RGB565 の紺色です。

# `normalize_display`

```elixir
@spec normalize_display(term()) :: {:ok, rgb565_value()} | {:error, term()}
```

利用者向けの表示色を RGB565 へ正規化します。

受け付ける値:

- RGB565 整数
- `:black`、`:white`、`:red` などの名前付き色
- `{:rgb565, value}`
- `{:rgb565, r, g, b}`
- `{:rgb888, value}`
- `{:rgb888, r, g, b}`
- `{:rgb, r, g, b}`

# `normalize_palette`

```elixir
@spec normalize_palette(term()) :: {:ok, rgb888_value()} | {:error, term()}
```

利用者向けの配色表の色を圧縮 RGB888 へ正規化します。

受け付ける値:

- 圧縮 RGB888 整数
- `:black`、`:white`、`:red` などの名前付き色
- `{:rgb888, value}`
- `{:rgb888, r, g, b}`
- `{:rgb, r, g, b}`
- `{:rgb565, value}`
- `{:rgb565, r, g, b}`

# `olive`

```elixir
@spec olive() :: rgb565_value()
```

RGB565 のオリーブ色です。

# `orange`

```elixir
@spec orange() :: rgb565_value()
```

RGB565 の橙色です。

# `palette`

```elixir
@spec palette(rgb888_value()) :: palette_descriptor()
```

圧縮 RGB888 の配色表色を `{:rgb888, value}` として明示します。

# `pink`

```elixir
@spec pink() :: rgb565_value()
```

RGB565 の桃色です。

# `pixels_be`

```elixir
@spec pixels_be([rgb565_value()]) :: binary()
```

RGB565 値の一覧をビッグエンディアン語へ符号化します。

# `pixels_le`

```elixir
@spec pixels_le([rgb565_value()]) :: binary()
```

RGB565 値の一覧を通常のリトルエンディアン語へ符号化します。

# `pixels_swap565`

```elixir
@spec pixels_swap565([rgb565_value()]) :: binary()
```

RGB565 値の一覧を、上流の `swap565_t` 形式に相当する事前入れ替え済みの生バイト列へ符号化します。

# `purple`

```elixir
@spec purple() :: rgb565_value()
```

RGB565 の紫色です。

# `red`

```elixir
@spec red() :: rgb565_value()
```

RGB565 の赤色です。

# `rgb565_be`

```elixir
@spec rgb565_be(rgb565_value()) :: binary()
```

1つの RGB565 値をビッグエンディアン16ビット語へ符号化します。

# `rgb565_le`

```elixir
@spec rgb565_le(rgb565_value()) :: binary()
```

1つの RGB565 値を通常のリトルエンディアン16ビット語へ符号化します。

# `silver`

```elixir
@spec silver() :: rgb565_value()
```

RGB565 の銀色です。

# `sky_blue`

```elixir
@spec sky_blue() :: rgb565_value()
```

RGB565 の空色色です。

# `swap565`

```elixir
@spec swap565(rgb565_value()) :: rgb565_value()
```

1つの RGB565 色値のバイト順を変換します。

# `swap565`

```elixir
@spec swap565(0..255, 0..255, 0..255) :: rgb565_value()
```

RGB 各成分を RGB565 色へまとめた後、バイト順を変換します。

# `swap888`

```elixir
@spec swap888(rgb888_value()) :: rgb888_value()
```

1つの RGB888 色値のバイト順を変換します。

# `swap888`

```elixir
@spec swap888(0..255, 0..255, 0..255) :: rgb888_value()
```

RGB 各成分を RGB888 色へまとめた後、バイト順を変換します。

# `transparent`

```elixir
@spec transparent() :: rgb565_value()
```

上流と同じ形式の特殊な透明色定数です。

# `violet`

```elixir
@spec violet() :: rgb565_value()
```

RGB565 のすみれ色色です。

# `white`

```elixir
@spec white() :: rgb565_value()
```

RGB565 の白色です。

# `yellow`

```elixir
@spec yellow() :: rgb565_value()
```

RGB565 の黄色です。

---

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