               (- h i))
           v (* v 255.0)
           m (* v (- 1.0 s))
-          n (* v (- 1.0 (* s f)))]
+          n (* v (- 1.0 (* s f)))
+          a (or a 1.0)]
       (coerce
         (condp = i
-          0 [v n m]
-          1 [n v m]
-          2 [m v n]
-          3 [m n v]
-          4 [n m v]
-            [v m n])))))
+          0 [v n m a]
+          1 [n v m a]
+          2 [m v n a]
+          3 [m n v a]
+          4 [n m v a]
+            [v m n a])))))
 
 (defn rgb->hsl
   "RGB to HSL (Hue, Saturation and Luminosity) conversion."

  (let [r (/ (red color) 255.0)
        g (/ (green color) 255.0)
        b (/ (blue color) 255.0)
        min-val (min r g b)
        max-val (max r g b)
        l (/ (+ max-val min-val) 2.0)]

  (let [r (/ (red color) 255.0)
        g (/ (green color) 255.0)
        b (/ (blue color) 255.0)
        a (alpha color)
        y (+ (* r  0.29900) (* g  0.58700) (* b  0.11400))
        u (+ (* r -0.14713) (* g -0.28886) (* b  0.43600))
        v (+ (* r  0.61500) (* g -0.51499) (* b -0.10001))]
    [y u v a]))

(defn yuv->rgb [[y u v a]]
  "Y'UV (Luma, Chrominance) to RGB Conversion."
  (let [r (* (+ y (* v 1.13983)) 255.0)
        g (* (- y (* u 0.39465) (* v 0.58060)) 255.0)
        b (* (+ y (* u 2.03211)) 255.0)]
    (coerce [r g b (or a 1.0)])))

(defn grayscale
  "RGB to greyscale conversion, largely by taking the Luma
   value from Y'UV conversion."
  [color]
  (let [[y _ _ a] (map (partial * 255.0) (rgb->yuv color))]
    (coerce [y y y a])))

(defn complementary
  "Complimentary color conversion, largely by taking the HSL
   value, and rotating the Hue by 180 degrees, and then converting
   back to RGB."
  [color]
  (let [[h s l a] (rgb->hsl color)]
    (hsl->rgb [(mod (+ h 180) 360) s l a])))