View Source Colorex.Color (Colorex v1.0.0)

Struct that represents a type opaque color. Automatically handles colorspace conversions and will keep the same color format as you used to create it.

Summary

Types

t()

This struct encapsulates a color and handles it's internal colorspace representation/conversions.

Types

color()

@type 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()}

t()

@opaque t()

This struct encapsulates a color and handles it's internal colorspace representation/conversions.