We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d224108 commit 0cd3204Copy full SHA for 0cd3204
lib/identicon.ex
@@ -9,6 +9,7 @@ defmodule Identicon do
9
def main(input) do
10
input
11
|> hash_input()
12
+ |> pick_color()
13
end
14
15
@doc """
@@ -21,4 +22,8 @@ defmodule Identicon do
21
22
23
%Identicon.Image{hex: hex}
24
25
+
26
+ def pick_color(%Identicon.Image{hex: [r, g, b | _rest]} = image) do
27
+ %Identicon.Image{image | color: {r, g, b}}
28
+ end
29
lib/image.ex
@@ -3,5 +3,6 @@ defmodule Identicon.Image do
3
Documentation for `Identicon.Image`.
4
"""
5
6
- defstruct hex: nil
+ defstruct hex: nil,
7
+ color: nil
8
0 commit comments