summaryrefslogtreecommitdiff
path: root/metapost/context/base/mpiv/mp-mlib.mpiv
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2016-07-18 17:05:11 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-07-18 17:05:11 +0200
commit50928735daee408de73737b055b2535d96424824 (patch)
treea16ca5d16734b5bc146f053fe0368e61f4c72400 /metapost/context/base/mpiv/mp-mlib.mpiv
parent3eb2d078f0023266585aec42d98326d72567b9d6 (diff)
downloadcontext-50928735daee408de73737b055b2535d96424824.tar.gz
2016-07-18 16:51:00
Diffstat (limited to 'metapost/context/base/mpiv/mp-mlib.mpiv')
-rw-r--r--metapost/context/base/mpiv/mp-mlib.mpiv14
1 files changed, 9 insertions, 5 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 ;