    (< hue 275) :red
    :else :purple))
 
+(defn scalar-to-hsl [color]
+  (apply colors/rgb-to-hsl (take 3 (.val color))))
+
+(defn scalar-color-name [color]
+  (let [[h _ _] (scalar-to-hsl color)]
+    (color-name h)))
+
 (def shape-colors
   (map (fn [i]
          (let [[r g b] (colors/hsl-to-rgb (* i 90) 50 50)]

(def h (atom nil))
(def c (atom nil))
(def r (atom nil))

(defn line-len
  ([p1 p2] (line-len (.x p1) (.y p1) (.x p2) (.y p2)))


(defn contour-hu-invariants [contour]
  (hu-invariants (Imgproc/moments contour)))

(defn shape-name [contour]
  (let [[h1] (contour-hu-invariants contour)]
    (cond (< h1 0.180) :oval
          (< h1 0.200) :diamond
          :else :squiggle)))

(defn contour-poly [contour]
  (let [poly2f (MatOfPoint2f.)
