       (doseq [[c x y] generator]
         (draw-cell g2d x y w h (color/coerce c))))
 
-    (close g2d-target)))
+    (close target)))
 
 ^:clj
 (defn bitmap []

                    (iterate inc 0)
                    (map pos)
                    (map cons color-swatch))
        g2d       (create-context g2d-target width height)]

    (doto g2d
      (.setBackground Color/WHITE)

(ns inkspot.palette
  (:require [inkspot.color :as color])
  ^:clj
  (:import (java.awt Color Graphics2D GraphicsEnvironment RenderingHints)
           (java.awt.image BufferedImage)
           (java.io StringWriter)
           (org.apache.batik.dom GenericDOMImplementation)
           (org.apache.batik.svggen SVGGraphics2D)))

(defprotocol IGraphics2DTarget
  (create-context [this width height])
