Skip to content

Commit a26e113

Browse files
committed
glitch - palette generator
1 parent f4346e4 commit a26e113

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/clojure2d/extra/glitch.clj

+3-11
Original file line numberDiff line numberDiff line change
@@ -369,23 +369,15 @@
369369
:palette (m/sample (c/iq-palette-random-gradient) num)})
370370
0.5 {:type :colourlovers
371371
:palette (rand-nth c/colourlovers-palettes)}
372-
0.6 (let [preset (rand-nth c/paletton-presets-list)
373-
p (rand-nth c/colourlovers-palettes)
374-
h (map #(c/paletton-rgb-to-hue %) p)]
375-
{:type :colourlovers-paletton
376-
:conf {:hue h
377-
:preset preset
378-
:type :monochromatic
379-
:compl false}
380-
:palette (let [v (reduce #(concat %1 (c/paletton %2 preset)) p h)]
381-
(vec v))})
372+
0.6 {:type :gradient
373+
:palette (m/sample (rand-nth (vals c/gradient-presets)) 7)}
382374
(let [h (r/drand 360.0)
383375
t (rand-nth [:monochromatic :triad :triad :triad :triad :triad :tetrad :tetrad :tetrad])
384376
conf {:compl (r/brand 0.6)
385377
:angle (r/drand 10.0 90.0)
386378
:adj (r/brand 0.5)
387379
:hue h
388-
:preset (rand-nth c/colourlovers-palettes)
380+
:preset (rand-nth c/paletton-presets-list)
389381
:type t}]
390382
{:type :paletton
391383
:conf conf

0 commit comments

Comments
 (0)