diff options
Diffstat (limited to 'metapost/context/base/mpiv/mp-mlib.mpiv')
-rw-r--r-- | metapost/context/base/mpiv/mp-mlib.mpiv | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/metapost/context/base/mpiv/mp-mlib.mpiv b/metapost/context/base/mpiv/mp-mlib.mpiv index cac84a6fd..689995df7 100644 --- a/metapost/context/base/mpiv/mp-mlib.mpiv +++ b/metapost/context/base/mpiv/mp-mlib.mpiv @@ -54,6 +54,7 @@ vardef transparency_alternative_to_number(expr name) = fi enddef ; + def namedcolor (expr n) = 1 withprescript "sp_type=named" @@ -1534,3 +1535,12 @@ def nofill text t = fill t withpostscript "collect" enddef ; % def withrule expr r = % if (t = "even-odd") or (t = "evenodd") : withpostscript "evenodd" fi % enddef ; + +% so we can do: withcolor "red" + +def resolvedcolor(expr s) = + % lua.mp.namedcolor(s) % conflicts with macro namedcolor + % lua.mp.NamedColor(s) % okay but, can also be + % lua.mp("NamedColor",s) % which gives expansion mess + runscript("mp.NamedColor('" & s & "')") % faster anyway +enddef ; |