diff --git a/collects/2htdp/tests/test-image.rkt b/collects/2htdp/tests/test-image.rkt index a542ee9804..fe26e36a46 100644 --- a/collects/2htdp/tests/test-image.rkt +++ b/collects/2htdp/tests/test-image.rkt @@ -882,6 +882,11 @@ => (rectangle 100 10 "solid" "blue")) +(test (overlay (rectangle 100 10 'solid (color 255 0 0 0)) + (rectangle 100 10 'solid (color 0 255 0 255)) + (rectangle 100 10 'solid (color 0 0 255 0))) + => + (rectangle 100 10 'solid (color 0 255 0))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; diff --git a/collects/mrlib/image-core.rkt b/collects/mrlib/image-core.rkt index b3030b28d8..12fe9df586 100644 --- a/collects/mrlib/image-core.rkt +++ b/collects/mrlib/image-core.rkt @@ -1065,7 +1065,8 @@ the mask bitmap and the original bitmap are all together in a single bytes! (make-object color% (color-red color) (color-green color) - (color-blue color)))) + (color-blue color) + (/ (color-alpha color) 255)))) (define (pen->pen-obj/cache pen) diff --git a/collects/teachpack/2htdp/scribblings/image.scrbl b/collects/teachpack/2htdp/scribblings/image.scrbl index ba2d64ebea..c3c9a43dba 100644 --- a/collects/teachpack/2htdp/scribblings/image.scrbl +++ b/collects/teachpack/2htdp/scribblings/image.scrbl @@ -1222,9 +1222,6 @@ This section lists predicates for the basic structures provided by the image lib The constructor, @racket[make-color], also accepts only three arguments, in which case the three arguments are used for the @racket[red], @racket[green], and @racket[blue] fields, and the @racket[alpha] field defaults to @racket[255]. - - Unfortunately, not all of the primitives that accept or produce @racket[color] structs use the @racket[alpha] - field; only @racket[image->color-list] and @racket[color-list->bitmap] do. } @defproc[(y-place? [x any/c]) boolean?]{