(standard-fish w h [ #:direction direction #:color color #:eye-color eye-color #:open-mouth open-mouth]) → pict? w : real? h : real? direction : (or/c 'left 'right) = 'left color : (or/c string? (is-a?/c color%)) = "blue" eye-color : (or/c string? (is-a?/c color%) #f) = "black" open-mouth : (or/c boolean? real?) = #f
The open-mouth argument can be either #f (mouth closed), #t (mouth fully open), or a number: 0.0 is closed, 1.0 is fully open, and numbers in between are partially open.
The style can include any of the following:
include a Racket logo on the machine’s screen
put 1s and 0s on the machine’s screen
like 'binary, and also give the machine horns and a tail
(thermometer [ #:height-% height-% #:color-% color-% #:ticks ticks #:start-color start-color #:end-color end-color #:top-circle-diameter top-circle-diameter #:bottom-circle-diameter bottom-circle-diameter #:stem-height stem-height #:mercury-inset mercury-inset]) → pict? height-% : (between/c 0 1) = 1 color-% : (between/c 0 1) = height-% ticks : non-exact-negative-integer? = 4 start-color : (or/c string? (is-a?/c color%)) = "lightblue" end-color : (or/c string? (is-a?/c color%)) = "lightcoral" top-circle-diameter : positive-real? = 40 bottom-circle-diameter : positive-real? = 80 stem-height : positive-real? = 180 mercury-inset : positive-real? = 8
The mercury is drawn the same way, but by creating the three components inset from the versions that draw the boundary of the thermometer. This inset is conrolled by the mercury-inset argument.
The height of the mercury in the thermometer is controlled by the height-% argument. Its color is interpolated between the start-color and end-color, as determined by the color-% argument.
Finally, some number of ticks are drawn, basd on the ticks argument.
The spike argument indicates the corner from which a spike protrudes from the balloon (i.e., the spike that points to whatever the balloon is about). For example, 'n means “north,”, which is a spike in the top middle of the balloon.
The dx and dy arguments specify how far the spike should protrude. For a 'w spike, dx should be negative, etc.
The color argument is the background color for the balloon.
The corner-radius argument determines the radius of the cicle used to roun the balloon’s corners. As usual, if it is less than 1, then it acts as a ratio of the balloon’s width or height.
The result is a balloon, not a pict. The balloon-pict function extracts a pict whose bounding box does not include the spike, but includes the rest of the image, and the balloon-point-x and balloon-point-y functions extract the location of the spike point. More typically, the pin-balloon function is used to add a balloon to a pict.
balloon : balloon? base : pict? x : real? y : real? (pin-balloon balloon base at-pict find) → pict? balloon : balloon? base : pict? at-pict : pict-path? find : (pict? pict-path? . -> . (values real? real?))
The resulting pict has the same bounding box, descent, and ascent as base, even if the balloon extends beyond the bounding box.
v : any/c (make-balloon pict x y) → balloon? pict : pict? x : real? y : real? (balloon-pict balloon) → pict? balloon : balloon? (balloon-point-x balloon) → real? balloon : balloon? (balloon-point-y balloon) → real? balloon : balloon?
The default background color for a balloon.
eyebrow-kind : (or/c 'none 'normal 'worried 'angry)
(or/c 'plain 'smaller 'narrow 'medium 'large 'huge 'grimace 'oh 'tongue) frown? : any/c color : (or/c string (is-a?/c color%)) eye-inset : real? eyebrow-dy : real? pupil-dx : real? pupil-dy : real? eyebrow-on? : any/c = #t mouth-on? : any/c = #t eye-on? : any/c = #t tongue-on? : any/c = #t face-bg-on? : any/c = #t teeth-on? : any/c = #t
eyebrow-kind determines the eyebrow shape.
mouth-kind determines the mouth shape, combined with frown?.
frown? determines whether the mouth is up or down.
color determines the face color.
eye-inset adjusts the eye size; recommend values are between 0 and 10.
eyebrow-dy adjusts the eyebrows; recommend values: between -5 and 5.
pupil-dx adjusts the pupil; recommend values are between -10 and 10.
pupil-dy adjusts the pupil; recommend values are between -15 and 15.
The #:eyebrow-shading? through #:face-background-shading? arguments control whether a shading is used for on a particular feature in the face (shading tends to look worse than just anti-aliasing when the face is small). The #:teeth? argument controls the visibility of the teeth for some mouth shapes.
(filled-flash width height [ n-points spike-fraction rotation]) → pict? width : real? height : real? n-points : exact-positive-integer? = 10 spike-fraction : (real-in 0 1) = 0.25 rotation : real? = 0
The height and width arguments determine the size of the oval in which the flash is drawn, prior to rotation. The actual height and width may be smaller if points is not a multiple of 4, and the actual height and width will be different if the flash is rotated.
The n-points argument determines the number of points on the flash.
The spike-fraction argument determines how big the flash spikes are compared to the bounding oval.
The rotation argument specifies an angle in radians for counter-clockwise rotation.
The flash is drawn in the default color.
(outline-flash width height [ n-points spike-fraction rotation]) → pict? width : real? height : real? n-points : exact-positive-integer? = 10 spike-fraction : (real-in 0 1) = 0.25 rotation : real? = 0