diff options
-rw-r--r-- | pict.scm | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -44,6 +44,7 @@ shrink rotate blur + cellophane frame @@ -408,6 +409,20 @@ strings that are built from the list of attributes LST." 2)))) (pict-sxml pict)))))) +(define (cellophane pict opacity) + "Set the opacity of PICT to OPACITY, a numeric value between 0 (for +full transparency) and 1 (for full opacity)." + (make-pict + `(svg (@ (height ,(pict-height pict)) + (width ,(pict-width pict)) + (class "opacity") + (x 0) + (y 0)) + ,((attribute-modifier 'opacity (const opacity)) + `(g (@ (class "opacity") + (opacity ,opacity)) + ,(pict-sxml pict)))))) + (define* (frame pict #:key (color "black") (stroke-width 1)) "Draw a box around PICT." (cc-superimpose pict |