diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2014-08-21 10:15:04 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2014-08-21 10:15:04 +0200 |
commit | 471adab575a305cb8c52614be3bd54e488e35c73 (patch) | |
tree | 6d5016557315e9e1e2b2470c835da802e1d12953 /metapost | |
parent | 26048fb1a13b467f694b3977fdad699ecc33064d (diff) | |
download | context-471adab575a305cb8c52614be3bd54e488e35c73.tar.gz |
2014-08-21 09:58:00
Diffstat (limited to 'metapost')
-rw-r--r-- | metapost/context/base/mp-mlib.mpiv | 26 |
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 |