   See: http://en.wikipedia.org/wiki/HSL_and_HSV"
   (import
     java.awt.Color))
+
+
+(defn color?
+  "Tests whether the given value is a valid color."
+  [value]
+  (and (integer? value)
+       (< Integer/MIN_VALUE value Integer/MAX_VALUE)))
+
 
 
 ;;;;; RGB COLOR SPACE ;;;;;

  "Takes a color value and returns a vector containing the hue, saturation, and
  value components as floating-point numbers."
  [color]
  (let [c (Color. (unchecked-int color))]
    (vec (Color/RGBtoHSB (.getRed c) (.getBlue c) (.getGreen c) nil))))


  "Takes a color value and returns a vector containing the red, green, and blue
  component channels as floating-point numbers."
  [color]
  {:pre [(color? color)]}
  (vec (.getRGBColorComponents (Color. (unchecked-int color)) nil)))


