sk requested empty scenes with optional background color

This commit is contained in:
Matthias Felleisen 2011-07-14 12:02:40 -04:00
parent da6e819b6f
commit 40948ee653
2 changed files with 13 additions and 7 deletions

View File

@ -882,10 +882,10 @@
(check-mode/color-combination 'square 3 mode color)
(make-a-polygon (rectangle-points side-length side-length) mode color))
(define/chk (empty-scene width height)
(define/chk (empty-scene width height [color 'white])
(crop 0 0 width height
(overlay (rectangle width height 'outline (pen "black" 2 'solid 'round 'round))
(rectangle width height 'solid 'white))))
(rectangle width height 'solid color))))
(define/chk (rhombus side-length angle mode color)
(check-mode/color-combination 'rhombus 3 mode color)

View File

@ -936,14 +936,20 @@ the @racket[point-count] argument determines how many points the star has.
Placing images into scenes is particularly useful when building worlds
and universes using @racket[2htdp/universe].
@defproc[(empty-scene [width (and/c real? (not/c negative?))]
[height (and/c real? (not/c negative?))])
image?]{
@defproc*[([(empty-scene [width (and/c real? (not/c negative?))]
[height (and/c real? (not/c negative?))])
image?]
[(empty-scene [width (and/c real? (not/c negative?))]
[height (and/c real? (not/c negative?))]
[color image-color?])
image?])]{
Creates an empty scene, i.e., a rectangle with a black outline.
Creates an empty scene, i.e., a white rectangle with a black outline.
@image-examples[(empty-scene 160 90)]
The three-argument version creates a rectangle of the specified color with
a black outline.
}
@defproc[(place-image [image image?] [x real?] [y real?] [scene image?]) image?]{