Tint v1.0.0-rc.1 Tint View Source
A library allowing calculations with colors and conversions between different colorspaces.
Link to this section Summary
Functions
Converts the given color to CMYK colorspace.
Converts the given color to DIN99 colorspace.
Converts the given color to HSV colorspace.
Converts the given color to CIELAB colorspace.
Converts the given color to RGB colorspace.
Converts the given color to CIE XYZ colorspace.
Link to this section Types
color()
View Source
color() ::
Tint.CMYK.t()
| Tint.DIN99.t()
| Tint.HSV.t()
| Tint.Lab.t()
| Tint.RGB.t()
| Tint.XYZ.t()
color() :: Tint.CMYK.t() | Tint.DIN99.t() | Tint.HSV.t() | Tint.Lab.t() | Tint.RGB.t() | Tint.XYZ.t()
A type representing a color.
Link to this section Functions
to_cmyk(color)
View Source
(since 0.3.0)
to_cmyk(color()) :: Tint.CMYK.t()
to_cmyk(color()) :: Tint.CMYK.t()
Converts the given color to CMYK colorspace.
Example
iex> Tint.to_cmyk(Tint.RGB.new(40, 66, 67)) #Tint.CMYK<40.3%,1.49%,0.0%,73.73%>
to_din99(color)
View Source
(since 1.0.0)
to_din99(color()) :: Tint.DIN99.t()
to_din99(color()) :: Tint.DIN99.t()
Converts the given color to DIN99 colorspace.
to_hsv(color)
View Source
to_hsv(color()) :: Tint.HSV.t()
to_hsv(color()) :: Tint.HSV.t()
Converts the given color to HSV colorspace.
Example
iex> Tint.to_hsv(Tint.RGB.new(255, 127, 30)) #Tint.HSV<25.9°,88.24%,100.0%>
to_lab(color)
View Source
(since 1.0.0)
to_lab(color()) :: Tint.Lab.t()
to_lab(color()) :: Tint.Lab.t()
Converts the given color to CIELAB colorspace.
to_rgb(color)
View Source
to_rgb(color()) :: Tint.RGB.t()
to_rgb(color()) :: Tint.RGB.t()
Converts the given color to RGB colorspace.
Example
iex> Tint.to_rgb(Tint.HSV.new(25.8, 0.882, 1)) #Tint.RGB<255,127,30 (#FF7F1E)>
to_xyz(color)
View Source
(since 1.0.0)
to_xyz(color()) :: Tint.XYZ.t()
to_xyz(color()) :: Tint.XYZ.t()
Converts the given color to CIE XYZ colorspace.