View Source Color (ExUnion v0.1.2)

Link to this section Summary

Link to this section Types

@type t() :: union()
@type union() ::
  Color.Hsla.t()
  | Color.Hsl.t()
  | Color.Rgba.t()
  | Color.Rgb.t()
  | Color.Hex.t()
@type union_hex() :: Color.Hex.t()
@type union_hsl() :: Color.Hsl.t()
@type union_hsla() :: Color.Hsla.t()
@type union_rgb() :: Color.Rgb.t()
@type union_rgba() :: Color.Rgba.t()

Link to this section Functions

@spec hex(string :: String.t()) :: Color.Hex.t()

See Color.Hex.new/1.

@spec hsl(fields :: %{hue: 0..360, saturation: float(), lightness: float()}) ::
  Color.Hsl.t()
@spec hsl(fields :: [hue: 0..360, saturation: float(), lightness: float()]) ::
  Color.Hsl.t()

See Color.Hsl.new/1.

Link to this function

hsl(hue, saturation, lightness)

View Source
@spec hsl(hue :: 0..360, saturation :: float(), lightness :: float()) :: Color.Hsl.t()

See Color.Hsl.new/3.

@spec hsla(
  fields :: %{
    hue: 0..360,
    saturation: float(),
    lightness: float(),
    alpha: float()
  }
) ::
  Color.Hsla.t()
@spec hsla(
  fields :: [
    hue: 0..360,
    saturation: float(),
    lightness: float(),
    alpha: float()
  ]
) ::
  Color.Hsla.t()

See Color.Hsla.new/1.

Link to this function

hsla(hue, saturation, lightness, alpha)

View Source
@spec hsla(
  hue :: 0..360,
  saturation :: float(),
  lightness :: float(),
  alpha :: float()
) ::
  Color.Hsla.t()

See Color.Hsla.new/4.

Link to this macro

is_color(value)

View Source (macro)
@spec rgb(fields :: %{red: 0..255, green: 0..255, blue: 0..255}) :: Color.Rgb.t()
@spec rgb(fields :: [red: 0..255, green: 0..255, blue: 0..255]) :: Color.Rgb.t()

See Color.Rgb.new/1.

@spec rgb(red :: 0..255, green :: 0..255, blue :: 0..255) :: Color.Rgb.t()

See Color.Rgb.new/3.

@spec rgba(fields :: %{red: 0..255, green: 0..255, blue: 0..255, alpha: float()}) ::
  Color.Rgba.t()
@spec rgba(fields :: [red: 0..255, green: 0..255, blue: 0..255, alpha: float()]) ::
  Color.Rgba.t()

See Color.Rgba.new/1.

Link to this function

rgba(red, green, blue, alpha)

View Source
@spec rgba(red :: 0..255, green :: 0..255, blue :: 0..255, alpha :: float()) ::
  Color.Rgba.t()

See Color.Rgba.new/4.