Tint v0.1.0 Tint.RGB View Source
A color in the RGB (red, green, blue) colorspace.
Link to this section Summary
Functions
Builds a new RGB color from the given hex code.
Builds a new RGB color from the given hex code. Raises when the given hex code is invalid.
Builds a new RGB color from red, green and blue color ratios.
Converts a tuple containing hue, saturation and value into a Tint.RGB
struct.
Builds a new RGB color from red, green and blue color values.
Converts a RGB color to a hex code.
Converts RGB color into a tuple containing the red, green and blue parts.
Link to this section Types
t()
View Source
t() :: %Tint.RGB{
blue: non_neg_integer(),
green: non_neg_integer(),
red: non_neg_integer()
}
t() :: %Tint.RGB{ blue: non_neg_integer(), green: non_neg_integer(), red: non_neg_integer() }
Link to this section Functions
from_hex(code) View Source
Builds a new RGB color from the given hex code.
from_hex!(code) View Source
Builds a new RGB color from the given hex code. Raises when the given hex code is invalid.
from_ratios(red_ratio, green_ratio, blue_ratio) View Source
Builds a new RGB color from red, green and blue color ratios.
from_tuple(arg) View Source
Converts a tuple containing hue, saturation and value into a Tint.RGB
struct.
new(red, green, blue) View Source
Builds a new RGB color from red, green and blue color values.
to_hex(color) View Source
Converts a RGB color to a hex code.
to_tuple(color)
View Source
to_tuple(t()) :: {non_neg_integer(), non_neg_integer(), non_neg_integer()}
to_tuple(t()) :: {non_neg_integer(), non_neg_integer(), non_neg_integer()}
Converts RGB color into a tuple containing the red, green and blue parts.