Re-added error checks in the color=? function, so error message comes

from the function you actually called, rather than an internal.
(cherry picked from commit ca98f85c39)
This commit is contained in:
Stephen Bloch 2013-12-17 14:53:05 -05:00 committed by Ryan Culpepper
parent edf479072e
commit ae53738402

View File

@ -141,12 +141,12 @@
(define (color=? c1 c2)
(let [[rc1 (colorize c1)]
[rc2 (colorize c2)]]
; (unless (color? rc1)
; (error 'color=?
; (format "Expected a color or color name as first argument, but received ~v" c1)))
; (unless (color? rc2)
; (error 'color=?
; (format "Expected a color or color name as second argument, but received ~v" c2)))
(unless (color? rc1)
(error 'color=?
(format "Expected a color or color name as first argument, but received ~v" c1)))
(unless (color? rc2)
(error 'color=?
(format "Expected a color or color name as second argument, but received ~v" c2)))
(and (= (color-alpha rc1) (color-alpha rc2)) ; Both alphas MUST be equal.
(or (= (color-alpha rc1) 0) ; If both are transparent, ignore rgb.
(and (= (color-red rc1) (color-red rc2))