This repository was archived by the owner on Jul 19, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +93
-1
lines changed Expand file tree Collapse file tree 2 files changed +93
-1
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ toGrid slots =
71
71
selectTendrils grid_ =
72
72
let
73
73
tendrils =
74
- getIn grid_. tendrils ( Color . harmonizesWith grid_. background)
74
+ getIn grid_. tendrils ( Color . inSameHue grid_. background)
75
75
in
76
76
Maybe . map
77
77
( \ tr ->
Original file line number Diff line number Diff line change @@ -102,6 +102,98 @@ filterLuminance pred colors_ =
102
102
103
103
104
104
105
+ -- Hue
106
+
107
+
108
+ type Hue
109
+ = Gray
110
+ | Orange
111
+ | Pink
112
+ | Purple
113
+ | Blue
114
+ | Green
115
+
116
+
117
+ hueOf : Color -> Hue
118
+ hueOf color =
119
+ if isGray color then
120
+ Gray
121
+
122
+ else if isOrange color then
123
+ Orange
124
+
125
+ else if isPink color then
126
+ Pink
127
+
128
+ else if isPurple color then
129
+ Purple
130
+
131
+ else if isBlue color then
132
+ Blue
133
+
134
+ else
135
+ Green
136
+
137
+
138
+ {- | Get all the other colors in the same hue as the given color
139
+ -}
140
+ inSameHue : Color -> List Color
141
+ inSameHue color =
142
+ let
143
+ sameHue =
144
+ case hueOf color of
145
+ Gray ->
146
+ grays
147
+
148
+ Orange ->
149
+ oranges
150
+
151
+ Pink ->
152
+ pinks
153
+
154
+ Purple ->
155
+ purples
156
+
157
+ Blue ->
158
+ blues
159
+
160
+ Green ->
161
+ greens
162
+ in
163
+ List . filter ( \ c -> c /= color) sameHue
164
+
165
+
166
+ isGray : Color -> Bool
167
+ isGray color =
168
+ List . member color grays
169
+
170
+
171
+ isOrange : Color -> Bool
172
+ isOrange color =
173
+ List . member color oranges
174
+
175
+
176
+ isPink : Color -> Bool
177
+ isPink color =
178
+ List . member color pinks
179
+
180
+
181
+ isPurple : Color -> Bool
182
+ isPurple color =
183
+ List . member color purples
184
+
185
+
186
+ isBlue : Color -> Bool
187
+ isBlue color =
188
+ List . member color blues
189
+
190
+
191
+ isGreen : Color -> Bool
192
+ isGreen color =
193
+ List . member color greens
194
+
195
+
196
+
105
197
-- Grays
106
198
107
199
You can’t perform that action at this time.
0 commit comments