From 471adab575a305cb8c52614be3bd54e488e35c73 Mon Sep 17 00:00:00 2001 From: Context Git Mirror Bot Date: Thu, 21 Aug 2014 10:15:04 +0200 Subject: 2014-08-21 09:58:00 --- metapost/context/base/mp-mlib.mpiv | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'metapost') diff --git a/metapost/context/base/mp-mlib.mpiv b/metapost/context/base/mp-mlib.mpiv index 56815028e..cc19b6805 100644 --- a/metapost/context/base/mp-mlib.mpiv +++ b/metapost/context/base/mp-mlib.mpiv @@ -76,16 +76,30 @@ def multitonecolor(expr name, fractions, components, value) = withprescript "sp_value=" & value enddef ; -def transparent(expr alternative, transparency)(text c) = +% def transparent(expr alternative, transparency)(text c) = +% 1 % this permits withcolor x intoshade y +% withprescript "tr_alternative=" & decimal transparency_alternative_to_number(alternative) +% withprescript "tr_transparency=" & decimal transparency +% withcolor c +% enddef ; + +let transparency = pair ; + +def transparent(expr t)(text c) = 1 % this permits withcolor x intoshade y - withprescript "tr_alternative=" & decimal transparency_alternative_to_number(alternative) - withprescript "tr_transparency=" & decimal transparency + withprescript "tr_alternative=" & decimal transparency_alternative_to_number(xpart t) + withprescript "tr_transparency=" & decimal ypart t withcolor c enddef ; -def withtransparency(expr alternative, transparency) = - withprescript "tr_alternative=" & decimal transparency_alternative_to_number(alternative) - withprescript "tr_transparency=" & decimal transparency +% def withtransparency(expr alternative, transparency) = +% withprescript "tr_alternative=" & decimal transparency_alternative_to_number(alternative) +% withprescript "tr_transparency=" & decimal transparency +% enddef ; + +def withtransparency expr t = + withprescript "tr_alternative=" & decimal transparency_alternative_to_number(xpart t) + withprescript "tr_transparency=" & decimal ypart t enddef ; def cmyk(expr c, m, y, k) = % provided for downward compability -- cgit v1.2.3