         freqs (map #(/ (double %) m/TWO_PI) (range (- rngs) rngs (r/irand 1 6)))
         ^double a1 (r/drand hwidth)
         a2 (r/drand (- hwidth a1))
-        ^double a3 (r/drand hwidth)
-        a4 (- hwidth a3)
+        ^double a3 (r/drand hheight)
+        a4 (- hheight a3)
         n [(make-jnoise) (make-jnoise) j/perlin-noise j/perlin-noise r/noise r/noise r/noise]
         palseq (filter #(> (c/get-luma (first %)) 100) (repeatedly #(:palette (g/color-reducer-machine))))
         pal1 (first palseq)
         pal2 (second palseq)
         c1 (first pal1)
         c2 (rand-nth pal1)
-        c3 (rand-nth pal2)
+        c3 (first pal2)
         c4 (rand-nth pal2)]
     {:f1 (rand-nth freqs)
      :f2 (rand-nth freqs)


;; Create canvas, windows, binpixels, configuration and iterate until window is closed
;; press `space` to save

(let [config (make-random-config)
      canvas (create-canvas width height)
      [_ run?] (show-window canvas "Harmonograph" 800 800 5)]

        bp))))

(defn draw-on-canvas
  "Render BinPixels to canvas."
  [canvas ^BinPixels bp]
  (p/set-canvas-pixels canvas (p/to-pixels bp
                                           (Vec4. 8 10 15 255)
