View Source Imglab.Color (imglab v0.3.0)

Provides a set of macros to specify color parameter values.

Link to this section Summary

Functions

Returns a named color as string. Useful to use a named color checking possible typos.

Returns a RGB color as string.

Returns a RGBA color as string.

Link to this section Functions

@spec color(binary()) :: binary()

Returns a named color as string. Useful to use a named color checking possible typos.

examples

Examples

iex> Imglab.Color.color("blue")
"blue"

iex> Imglab.Color.color("green")
"green"

iex> Imglab.Color.color("white")
"white"
Link to this macro

color(r, g, b)

View Source (macro)
@spec color(integer(), integer(), integer()) :: binary()

Returns a RGB color as string.

examples

Examples

iex> Imglab.Color.color(128, 128, 128)
"128,128,128"

iex> Imglab.Color.color(255, 128, 50)
"255,128,50"

iex> Imglab.Color.color(255, 0, 0)
"255,0,0"
Link to this macro

color(r, g, b, a)

View Source (macro)
@spec color(integer(), integer(), integer(), integer()) :: binary()

Returns a RGBA color as string.

examples

Examples

iex> Imglab.Color.color(128, 128, 128, 128)
"128,128,128,128"

iex> Imglab.Color.color(255, 128, 128, 50)
"255,128,128,50"

iex> Imglab.Color.color(255, 128, 0, 0)
"255,128,0,0"