Skip to content

Commit

Permalink
fix: docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tlux committed Apr 14, 2020
1 parent 1fdd879 commit 49919f8
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions lib/tint.ex
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ defmodule Tint do
## Examples
iex> Tint.convert(Tint.RGB.new(40, 66, 67), :cmyk)
{:ok, %Tint.CMYK{cyan: 0.403, magenta: 0.0149, yellow: 0.0, key: 0.7373}}
iex> Tint.convert(Tint.RGB.new(40, 66, 67), :cmyk)
{:ok, %Tint.CMYK{cyan: 0.403, magenta: 0.0149, yellow: 0.0, key: 0.7373}}
iex> Tint.convert(Tint.RGB.new(255, 127, 30), Tint.HSV)
{:ok, %Tint.HSV{hue: 25.9, saturation: 0.8824, value: 1.0}}
iex> Tint.convert(Tint.RGB.new(255, 127, 30), Tint.HSV)
{:ok, %Tint.HSV{hue: 25.9, saturation: 0.8824, value: 1.0}}
iex> Tint.convert(Tint.RGB.new(255, 127, 30), :invalid)
:error
iex> Tint.convert(Tint.RGB.new(255, 127, 30), :invalid)
:error
"""
@doc since: "1.0.0"
@spec convert(color, colorspace) :: {:ok, color} | :error
Expand All @@ -68,14 +68,14 @@ defmodule Tint do
## Examples
iex> Tint.convert!(Tint.RGB.new(40, 66, 67), :cmyk)
%Tint.CMYK{cyan: 0.403, magenta: 0.0149, yellow: 0.0, key: 0.7373}
iex> Tint.convert!(Tint.RGB.new(40, 66, 67), :cmyk)
%Tint.CMYK{cyan: 0.403, magenta: 0.0149, yellow: 0.0, key: 0.7373}
iex> Tint.convert!(Tint.RGB.new(255, 127, 30), Tint.HSV)
%Tint.HSV{hue: 25.9, saturation: 0.8824, value: 1.0}
iex> Tint.convert!(Tint.RGB.new(255, 127, 30), Tint.HSV)
%Tint.HSV{hue: 25.9, saturation: 0.8824, value: 1.0}
iex> Tint.convert!(Tint.RGB.new(255, 127, 30), :foo)
** (ArgumentError) Unknown colorspace: :foo
iex> Tint.convert!(Tint.RGB.new(255, 127, 30), :foo)
** (ArgumentError) Unknown colorspace: :foo
"""
@doc since: "1.0.0"
@spec convert!(color, colorspace) :: color
Expand All @@ -94,8 +94,8 @@ defmodule Tint do
## Example
iex> Tint.to_cmyk(Tint.RGB.new(40, 66, 67))
#Tint.CMYK<40.3%,1.49%,0.0%,73.73%>
iex> Tint.to_cmyk(Tint.RGB.new(40, 66, 67))
#Tint.CMYK<40.3%,1.49%,0.0%,73.73%>
"""
@doc since: "0.3.0"
@spec to_cmyk(color) :: CMYK.t()
Expand All @@ -113,8 +113,8 @@ defmodule Tint do
## Example
iex> Tint.to_hsv(Tint.RGB.new(255, 127, 30))
#Tint.HSV<25.9°,88.24%,100.0%>
iex> Tint.to_hsv(Tint.RGB.new(255, 127, 30))
#Tint.HSV<25.9°,88.24%,100.0%>
"""
@spec to_hsv(color) :: HSV.t()
defdelegate to_hsv(color), to: HSV.Convertible, as: :convert
Expand All @@ -131,8 +131,8 @@ defmodule Tint do
## Example
iex> Tint.to_rgb(Tint.HSV.new(25.8, 0.882, 1))
#Tint.RGB<255,127,30 (#FF7F1E)>
iex> Tint.to_rgb(Tint.HSV.new(25.8, 0.882, 1))
#Tint.RGB<255,127,30 (#FF7F1E)>
"""
@spec to_rgb(color) :: RGB.t()
defdelegate to_rgb(color), to: RGB.Convertible, as: :convert
Expand Down

0 comments on commit 49919f8

Please sign in to comment.