PasteRack.org
Paste # 57837
2017-10-13 17:57:31

Forked from paste # 98623.

Fork as a new paste.

Paste viewed 77 times.


Embed:

  1. #lang racket
  2. (require pict racket/draw)
  3. (define (happy-eyes width height [boldness 0.1])
  4.  (dc (lambda (dc dx dy)
  5.       (define old-brush (send dc get-brush))
  6.       (send dc set-brush
  7.         (send the-brush-list find-or-create-brush
  8.                               "black"
  9.                           'solid))
  10.       (define eye-path (new dc-path%))
  11.       (send eye-path arc dx dy width height 0 pi)
  12.       (send eye-path arc dx (+ dy (* height boldness))
  13.             width (* height boldness) pi 0 #f)
  14.       (send eye-path close)
  15.       (send dc draw-path eye-path dx dy)
  16.       (send dc set-brush old-brush))
  17.      width height))
  18.  
  19. (for/list ([boldness (in-range 0.1 0.71 0.1)])
  20.           (happy-eyes 50 80 boldness))

=>

'(image image image image image image image)