                   [y x])
      }))
 
+(defn make-hsla [hue]
+  "Create a string hex color from a hue, ex: #ff0000"
+  (let [hsla (clojure.string/replace "hsla(_,80%,50%,1)" #"_" (str hue))]
+    @(-> hsla col/css col/as-int24 col/as-css)))
+
 (defn make-circle-zero [p triple xoff roff cr]
   "Large solid circle"
   (let [[x y hue] triple
         c (.circle p (- cr roff))
-        hue (js/Snap.hsl hue 80 50)]
+        hsla (make-hsla hue)]
     (.attr c (clj->js {:cx (- (+ xoff x) cr)
                        :cy (- (+ xoff y) cr)
-                       :fill hue}))))
+                       :fill hsla}))))
 
 (defn make-circle-one [p triple xoff roff cr]
   "Ring"
   (let [[x y hue] triple
         c (.circle p (- (- cr (/ cr 4)) roff))
-        hue (js/Snap.hsl hue 80 50)]
-    (log-str #js [p c])
+        hsla (make-hsla hue)]
     (.attr c (clj->js {:cx (- (+ xoff x) cr)
                        :cy (- (+ xoff y) cr)
-                       :fill hue}))))
+                       :fill "#fff"
+                       :stroke-width (/ cr 4)
+                       :stroke hsla}))))
 
 (defn make-circle-two [p triple xoff roff cr]
   "Small solid circle"
   (let [[x y hue] triple
         c (.circle p (- (- cr (/ cr 3)) roff))
-        hue (js/Snap.hsl hue 80 50)]
+        hsla (make-hsla hue)]
     (.attr c (clj->js {:cx (- (+ xoff x) cr)
                        :cy (- (+ xoff y) cr)
-                       :fill hue}))))
+                       :fill hsla}))))
 
 (defn make-identikon [p ints hues]
   "Determine which circle to show by converting the int to mod 3"

  (sort (mapv #(Math/floor (* 1.411 %)) l))) ;; convert 0-255 to 0-360

(defn find-hues [ints]
  (let [remains (drop 15 ints)]
    (vector (first remains) (last remains))))

(defn get-svg-attrs [p]
  "Extract a bunch of attributes from the SVG object and calculate the x,y positions
for all the circles and their radii"
  (let [{svg :svg rwidth :w rheight :h} p
        attr (.attr svg)
        amt 5
        total (* amt amt)

(ns identikon-cljs.core
  (:require
   [cljs-hash.goog :as gh]
   [thi.ng.color.core :as col]
   [cljsjs.svgjs]))

(enable-console-print!)

(defn log-str
  ([x]   (do (.log js/console (pr-str x)) x))
  ([m x] (do (log-str {:msg m :data x})   x)))

(defn sha1 [str]
  (gh/sha1-hex str))
