jolby/colors — pull request #2 by austinjones (2013-01-10 06:59:08+00:00)
Title: "throw-if-not" accidentally throws IllegalArgumentExceptions

eval this in repl. the luminosity value is out of range.
(create-color {:h 1.0 :s 1.0 :l 111.0})

Before this change, the exception was thrown:
"IllegalArgumentException No matching ctor found for class java.lang.Exception clojure.lang.Reflector.invokeConstructor (Reflector.java:183)"

Exception has no constructor which takes a clojure.lang.ArraySeq, and it is an ArraySeq which is being passed to the Exception constructor.

After the change, the exception thrown is:
"Exception Elements must be of the form:
H (Hue): Float value in the range of: 0.0 - 360.0
S (Saturation): Float value in the range: 0.0 - 100.0
L (Lightness or Luminance): Float value in the range 0.0 - 100.0
1.0 1.0 111.0 sun.reflect.NativeConstructorAccessorImpl.newInstance0 (NativeConstructorAccessorImpl.java:-2)"

Much better...