diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-07-18 17:05:11 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-07-18 17:05:11 +0200 |
commit | 50928735daee408de73737b055b2535d96424824 (patch) | |
tree | a16ca5d16734b5bc146f053fe0368e61f4c72400 /metapost | |
parent | 3eb2d078f0023266585aec42d98326d72567b9d6 (diff) | |
download | context-50928735daee408de73737b055b2535d96424824.tar.gz |
2016-07-18 16:51:00
Diffstat (limited to 'metapost')
-rw-r--r-- | metapost/context/base/mpiv/mp-mlib.mpiv | 14 | ||||
-rw-r--r-- | metapost/context/base/mpiv/mp-tool.mpiv | 2 |
2 files changed, 10 insertions, 6 deletions
diff --git a/metapost/context/base/mpiv/mp-mlib.mpiv b/metapost/context/base/mpiv/mp-mlib.mpiv index 2b9b8bef6..75a6b51b9 100644 --- a/metapost/context/base/mpiv/mp-mlib.mpiv +++ b/metapost/context/base/mpiv/mp-mlib.mpiv @@ -1538,16 +1538,20 @@ def nofill text t = fill t withpostscript "collect" 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 + % 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 + if string s : + runscript("mp.NamedColor('" & s & "')") % faster anyway + else : + s + fi enddef ; % A comment will end up on top of the graphic in the output. This can be handy for % locating a graphic: comment("test graphic"). -def comment(expr str) = +def comment expr str = special "metapost.comment[[" & str & "]]" ; enddef ; diff --git a/metapost/context/base/mpiv/mp-tool.mpiv b/metapost/context/base/mpiv/mp-tool.mpiv index 09cf24103..9e086f0df 100644 --- a/metapost/context/base/mpiv/mp-tool.mpiv +++ b/metapost/context/base/mpiv/mp-tool.mpiv @@ -1040,7 +1040,7 @@ primarydef p randomized s = ( ((uniformdeviate s) * p) fi elseif string p : - resolvedcolor(p) randomized s + (resolvedcolor(p)) randomized s else : p + uniformdeviate s fi |