summaryrefslogtreecommitdiff
path: root/metapost/context/base/mp-mlib.mpiv
diff options
context:
space:
mode:
Diffstat (limited to 'metapost/context/base/mp-mlib.mpiv')
-rw-r--r--metapost/context/base/mp-mlib.mpiv26
1 files changed, 20 insertions, 6 deletions
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