Tint v0.3.0 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 HSV colorspace.
Converts the given color to RGB colorspace.
Link to this section Types
Link to this type
color()
View Source
color()
View Source
color() :: Tint.CMYK.t() | Tint.HSV.t() | Tint.RGB.t()
color() :: Tint.CMYK.t() | Tint.HSV.t() | Tint.RGB.t()
A type representing a color.
Link to this section Functions
Link to this function
to_cmyk(color)
View Source
to_cmyk(color)
View Source
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.2%,1.4%,0%,73.7%>
Link to this function
to_hsv(color)
View Source
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.8°,88.2%,100%>
Link to this function
to_rgb(color)
View Source
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>