Skip to content

Commit

Permalink
refactor: restructure protocols
Browse files Browse the repository at this point in the history
  • Loading branch information
tlux committed Mar 29, 2020
1 parent 50f248e commit 1247353
Show file tree
Hide file tree
Showing 23 changed files with 21 additions and 29 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions lib/tint/din99/conversions/from_any.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
defimpl Tint.DIN99.Convertible, for: Any do
def to_din99(color) do
color
|> Tint.to_rgb()
|> Tint.to_din99()
end
end
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 0 additions & 8 deletions lib/tint/din99/convertible.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,3 @@ defprotocol Tint.DIN99.Convertible do
@spec to_din99(Tint.color()) :: Tint.DIN99.t()
def to_din99(color)
end

defimpl Tint.DIN99.Convertible, for: Any do
def to_din99(color) do
color
|> Tint.to_rgb()
|> Tint.to_din99()
end
end
7 changes: 7 additions & 0 deletions lib/tint/hsv/conversions/from_any.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
defimpl Tint.HSV.Convertible, for: Any do
def to_hsv(color) do
color
|> Tint.to_rgb()
|> Tint.to_hsv()
end
end
File renamed without changes.
File renamed without changes.
8 changes: 0 additions & 8 deletions lib/tint/hsv/convertible.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,3 @@ defprotocol Tint.HSV.Convertible do
@spec to_hsv(Tint.color()) :: Tint.HSV.t()
def to_hsv(color)
end

defimpl Tint.HSV.Convertible, for: Any do
def to_hsv(color) do
color
|> Tint.to_rgb()
|> Tint.to_hsv()
end
end
7 changes: 7 additions & 0 deletions lib/tint/lab/conversions/from_any.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
defimpl Tint.Lab.Convertible, for: Any do
def to_lab(color) do
color
|> Tint.to_rgb()
|> Tint.to_lab()
end
end
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 0 additions & 8 deletions lib/tint/lab/convertible.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,3 @@ defprotocol Tint.Lab.Convertible do
@spec to_lab(Tint.color()) :: Tint.Lab.t()
def to_lab(color)
end

defimpl Tint.Lab.Convertible, for: Any do
def to_lab(color) do
color
|> Tint.to_rgb()
|> Tint.to_lab()
end
end
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 0 additions & 5 deletions lib/tint/xyz/conversions/to_rgb.ex

This file was deleted.

0 comments on commit 1247353

Please sign in to comment.