Fledex.Color.RGB (fledex v0.7.0)

View Source

This module represents an RGB color. Fledex does commonly use a {r, g, b}-tuple, but this module makes the purpose more clear.

It also provides the necessary conversion functions to the 0xrrggbb (colorint) and{r,g,b} (tuple) representations.

Summary

Functions

creates a new RGB structure from any kind of color structure

Converts an Fledex.Color.RGB color to a rgb tuple

Types

t()

@type t() :: %Fledex.Color.RGB{b: 0..255, g: 0..255, r: 0..255}

Functions

new(color)

@spec new(Fledex.Color.Types.color()) :: t()

creates a new RGB structure from any kind of color structure

to_tuple(rgb)

Converts an Fledex.Color.RGB color to a rgb tuple