summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2014-12-10 21:15:04 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2014-12-10 21:15:04 +0100
commit7b68e6df9eb6d5c9f216c333051ccafce11bf3fb (patch)
tree6a588c8728fa6ff0ce1e9c54be0da1615eca1c56 /metapost
parent66a7d730de0d2823007aab1d742a27e8c2071e25 (diff)
downloadcontext-7b68e6df9eb6d5c9f216c333051ccafce11bf3fb.tar.gz
2014-12-10 20:15:00
Diffstat (limited to 'metapost')
-rw-r--r--metapost/context/base/mp-mlib.mpiv23
1 files changed, 20 insertions, 3 deletions
diff --git a/metapost/context/base/mp-mlib.mpiv b/metapost/context/base/mp-mlib.mpiv
index 5e7a15395..c0cb499fa 100644
--- a/metapost/context/base/mp-mlib.mpiv
+++ b/metapost/context/base/mp-mlib.mpiv
@@ -90,9 +90,26 @@ enddef ;
let transparency = pair ;
-def withtransparency expr t =
- withprescript "tr_alternative=" & decimal transparency_alternative_to_number(xpart t)
- withprescript "tr_transparency=" & decimal ypart t
+% def withtransparency expr t =
+% withprescript "tr_alternative=" & decimal transparency_alternative_to_number(xpart t)
+% withprescript "tr_transparency=" & decimal ypart t
+% enddef ;
+%
+% withtransparency (1,.5)
+% withtransparency ("normal",.5)
+
+def withtransparency (expr t) (text rest) =
+ if pair t :
+ withprescript "tr_alternative=" & decimal transparency_alternative_to_number(xpart t)
+ withprescript "tr_transparency=" & decimal ypart t
+ else :
+ mfun_with_transparency (transparency_alternative_to_number(t))
+ fi rest
+enddef ;
+
+def mfun_with_transparency (expr a) expr t =
+ withprescript "tr_alternative=" & decimal a
+ withprescript "tr_transparency=" & decimal t
enddef ;
def cmyk(expr c, m, y, k) = % provided for downward compability