diff options
author | Hans Hagen <pragma@wxs.nl> | 2019-07-16 22:42:53 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2019-07-16 22:42:53 +0200 |
commit | a92a8d40ce567ecf5b0baacd9a93a94aac9a4a2d (patch) | |
tree | 17f7038c1c3b353bc2130af87066676d49f87184 /metapost/context/base/mpiv/mp-tool.mpiv | |
parent | 4bc28891615011ed3581836e9259434720e25830 (diff) | |
download | context-a92a8d40ce567ecf5b0baacd9a93a94aac9a4a2d.tar.gz |
2019-07-16 18:30:00
Diffstat (limited to 'metapost/context/base/mpiv/mp-tool.mpiv')
-rw-r--r-- | metapost/context/base/mpiv/mp-tool.mpiv | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/metapost/context/base/mpiv/mp-tool.mpiv b/metapost/context/base/mpiv/mp-tool.mpiv index cabdf9ab2..f1f31e5f0 100644 --- a/metapost/context/base/mpiv/mp-tool.mpiv +++ b/metapost/context/base/mpiv/mp-tool.mpiv @@ -895,9 +895,36 @@ enddef ; let normalwithcolor = withcolor ; def withcolor expr c = - normalwithcolor if string c : resolvedcolor(c) else : c fi + normalwithcolor if string c : resolvedcolor(c) else : c fi enddef ; +% I don't want a "withcolor black" in case of an empty string ... who knows +% how that can interfere with outer colors. Somehow the next one doesn't +% always work out ok, but why ... must be some parsing issue. Anyway, when +% we cannot do that, we need to fix some chem macros instead as empty strings +% now lead to black while everywhere else in context empty means: leave color +% untouched. + +% def withcolor expr c = +% if not string c : +% normalwithcolor c +% elseif c <> "" : +% normalwithcolor resolvedcolor(c) +% fi +% enddef ; + +% So why does this work better than the above: +% +% def withcolor expr c = +% if string c : +% if c <> "" : +% normalwithcolor resolvedcolor(c) +% fi +% else : +% normalwithcolor c +% fi +% enddef ; + vardef colortype expr c = if cmykcolor c : cmykcolor elseif rgbcolor c : rgbcolor |