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:
parent
edf479072e
commit
ae53738402
|
@ -141,12 +141,12 @@
|
||||||
(define (color=? c1 c2)
|
(define (color=? c1 c2)
|
||||||
(let [[rc1 (colorize c1)]
|
(let [[rc1 (colorize c1)]
|
||||||
[rc2 (colorize c2)]]
|
[rc2 (colorize c2)]]
|
||||||
; (unless (color? rc1)
|
(unless (color? rc1)
|
||||||
; (error 'color=?
|
(error 'color=?
|
||||||
; (format "Expected a color or color name as first argument, but received ~v" c1)))
|
(format "Expected a color or color name as first argument, but received ~v" c1)))
|
||||||
; (unless (color? rc2)
|
(unless (color? rc2)
|
||||||
; (error 'color=?
|
(error 'color=?
|
||||||
; (format "Expected a color or color name as second argument, but received ~v" c2)))
|
(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.
|
(and (= (color-alpha rc1) (color-alpha rc2)) ; Both alphas MUST be equal.
|
||||||
(or (= (color-alpha rc1) 0) ; If both are transparent, ignore rgb.
|
(or (= (color-alpha rc1) 0) ; If both are transparent, ignore rgb.
|
||||||
(and (= (color-red rc1) (color-red rc2))
|
(and (= (color-red rc1) (color-red rc2))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user