View Source Colorex.Utils (Colorex v1.0.0)

Some handy functions for working with colors

Summary

Functions

Convienience function to get the color black

Print a visual of two colors being mixed.

Print a row of color swatches.

Generates a random color.

Convienience function to get the color white

Types

color()

@type color() :: Colorex.Color.t() | colorspace_color()

color_key()

@type color_key() ::
  :red
  | :green
  | :blue
  | :alpha
  | :hue
  | :saturation
  | :lightness
  | :l
  | :a
  | :b
  | :cyan
  | :magenta
  | :yellow
  | :black
  | :x
  | :y
  | :z

colorspace_color()

@type colorspace_color() ::
  Colorex.RGB.t()
  | Colorex.HSL.t()
  | Colorex.LAB.t()
  | Colorex.XYZ.t()
  | Colorex.CMYK.t()

float_0_to_1()

@type float_0_to_1() :: float()

integer_0_to_255()

@type integer_0_to_255() :: pos_integer()

rgba_tuple()

@type rgba_tuple() ::
  {integer_0_to_255(), integer_0_to_255(), integer_0_to_255(), float_0_to_1()}

Functions

black()

@spec black() :: Colorex.Color.t()

Convienience function to get the color black

random()

Generates a random color.

white()

@spec white() :: Colorex.Color.t()

Convienience function to get the color white