 
   If passed one arg - it is assumed to be an int (i.e. a color),
    multiple args are converted to floats."
-  ([col-int] (.emissive *applet* (int col-int)))
-  ([r g b] (.emissive *applet* (float r) (float g) (float b))))
-
-(defn end-raw [] (.endRaw *applet*))
+  ([c] (if (int-like? c) (emissive-int c) (emissive-float c)))
+  ([r g b] (emissive-float r g b)))
+
+(defn end-raw
+  "Complement to begin-raw; they must always be used together. See
+  the begin-raw docstring for details."
+  []
+  (.endRaw *applet*))
 
 (defn end-shape
   "May only be called after begin-shape. When end-shape is called,

(def ^{:dynamic true} ^PApplet *applet*)
(def ^{:dynamic true} *state*)

(defn state
  "Retrieve canvas-specific state by key. Must initially call
  set-state! to store state.

  will specify that all subsequent shapes will be filled with orange."
  ([gray] (.fill *applet* (float gray)))
  ([gray alpha] (.fill *applet* (float gray) (float alpha)))
  ([r g b] (.fill *applet* (float r) (float g) (float b)))
  ([r g b alpha] (.fill *applet* (float r) (float g) (float b) (float alpha))))

(defn fill-int
  "Sets the color used to fill shapes."
  ([rgb] (.fill *applet* (int rgb)))
  ([rgb alpha] (.fill *applet* (int rgb) (float alpha))))

(defn fill
  "Sets the color used to fill shapes."
  ([rgb] (if (int-like? rgb) (fill-int rgb) (fill-float rgb)))
  ([rgb alpha] (if (int-like? rgb) (fill-int rgb alpha) (fill-float rgb alpha)))
  ([r g b] (fill-float r g b))
  ([r g b a] (fill-float r g b a)))

(def ^{:private true}
  filter-map {:threshold THRESHOLD
