From 7b68e6df9eb6d5c9f216c333051ccafce11bf3fb Mon Sep 17 00:00:00 2001 From: Context Git Mirror Bot Date: Wed, 10 Dec 2014 21:15:04 +0100 Subject: 2014-12-10 20:15:00 --- metapost/context/base/mp-mlib.mpiv | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'metapost') 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 -- cgit v1.2.3