Linocut.Palette (Linocut v0.1.3)

Copy Markdown View Source

Colour specifications and the named colours a picture may use.

Linocut.Palette.color("#c33")      # => {204, 51, 51, 255}
Linocut.Palette.color(:cyan)       # => {0, 255, 255, 255}
Linocut.Palette.color({1, 2, 3})   # => {1, 2, 3, 255}

Summary

Functions

The {r, g, b, a} a specification means. Raises ArgumentError for one it cannot read.

Every named colour.

Types

spec()

@type spec() ::
  String.t()
  | atom()
  | {0..255, 0..255, 0..255}
  | {0..255, 0..255, 0..255, 0..255}

Functions

color(rgba)

@spec color(spec()) :: {0..255, 0..255, 0..255, 0..255}

The {r, g, b, a} a specification means. Raises ArgumentError for one it cannot read.

names()

@spec names() :: [atom()]

Every named colour.