diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2018-04-12 20:35:16 +0200 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2018-04-12 20:35:16 +0200 |
commit | a3b3403a83dcaab9362186a8eac130c0c7e61ab7 (patch) | |
tree | 44b5764dc990119a3c03b9f3d137c040e48306a8 | |
parent | 6f8cc553eb2982e55e18434599143b5b90220b5d (diff) |
Add cellophane.
-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 |