[plt-scheme] slideshow, colorizing the background

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sat Jan 16 15:28:09 EST 2010

At Sat, 16 Jan 2010 14:54:15 -0500, Faré wrote:
> Is there a way to locally or globally colorize the background in slideshow?
> For a global change, I tried superimposing a big blob of color in the
> assembler, but it seems to only play so well with other assemblers
> (maybe I should try chaining assemblers differently). For a local
> change, I haven't found a tolerable way.

Locally, I'd superimpose a picture onto a color rectangle:

 #lang slideshow

 (define (add-bg p color)
   (refocus (cc-superimpose
             (colorize
              (filled-rectangle (pict-width p)
                                (pict-height p))
              color)
             p)
            p))

 (add-bg (bt "Hello") "green")

To globally set the background, I'd use that in an assembler:

 #lang slideshow

 (define (add-bg p color)
   (refocus (cc-superimpose
             (colorize
              (filled-rectangle (pict-width p)
                                (pict-height p))
              color)
             p)
            p))

 (current-slide-assembler
  (let ([orig (current-slide-assembler)])
    (lambda (title sep body)
      (ct-superimpose
       (inset (add-bg (inset full-page margin) "green") 
              (- margin))
       (orig title sep body)))))

 (slide #:title "Example" (bt "Hello"))



Posted on the users mailing list.