diff options
Diffstat (limited to 'metapost')
-rw-r--r-- | metapost/context/base/mpiv/mp-mlib.mpiv | 12 | ||||
-rw-r--r-- | metapost/context/base/mpiv/mp-tool.mpiv | 4 |
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 abef3d52c..b80d2b564 100644 --- a/metapost/context/base/mpiv/mp-mlib.mpiv +++ b/metapost/context/base/mpiv/mp-mlib.mpiv @@ -74,16 +74,16 @@ def namedcolor expr n = withprescript "sp_name=" & n enddef ; -% def spotcolor(expr n, v) = +% def mfun_spotcolor(expr n, v) = % 1 -% withprescript "sp_type=spot" +% withprescript "sp_type=xspot" % withprescript "sp_name=" & n % withprescript "sp_value=" & (if numeric v : decimal v else : v fi) % enddef ; -% -% def multitonecolor(expr name, fractions, components, value) = + +% def mfun_multispotcolor(expr name, fractions, components, value) = % 1 -% withprescript "sp_type=multitone" +% withprescript "sp_type=multispot" % withprescript "sp_name=" & name % withprescript "sp_fractions=" & decimal fractions % withprescript "sp_components=" & components @@ -97,6 +97,8 @@ def spotcolor(expr name, v) = withprescript "sp_value=" & colordecimals v enddef ; +% In this case a mixed color will be calculated: + def multitonecolor(expr name)(text t) = (1) withprescript "sp_type=multitone" diff --git a/metapost/context/base/mpiv/mp-tool.mpiv b/metapost/context/base/mpiv/mp-tool.mpiv index 281767522..8a11d8fda 100644 --- a/metapost/context/base/mpiv/mp-tool.mpiv +++ b/metapost/context/base/mpiv/mp-tool.mpiv @@ -2883,13 +2883,15 @@ enddef ; % This could be standard mplib 2 behaviour: +% vardef rcomponent expr p = if rgbcolor p : redpart elseif cmykcolor p : 1 - cyanpart fi p enddef ; + vardef rcomponent expr p = if rgbcolor p : redpart p elseif cmykcolor p : 1 - cyanpart p else : p fi enddef ; vardef gcomponent expr p = if rgbcolor p : greenpart p elseif cmykcolor p : 1 - magentapart p else : p fi enddef ; vardef bcomponent expr p = if rgbcolor p : bluepart p elseif cmykcolor p : 1 - yellowpart p else : p fi enddef ; vardef ccomponent expr p = if cmykcolor p : cyanpart p elseif rgbcolor p : 1 - redpart p else : p fi enddef ; vardef mcomponent expr p = if cmykcolor p : magentapart p elseif rgbcolor p : 1 - greenpart p else : p fi enddef ; vardef ycomponent expr p = if cmykcolor p : yellowpart p elseif rgbcolor p : 1 - bluepart p else : p fi enddef ; -vardef bcomponent expr p = if cmykcolor p : blackpart p elseif rgbcolor p : 0 else : p fi enddef ; +vardef kcomponent expr p = if cmykcolor p : blackpart p elseif rgbcolor p : 0 else : p fi enddef ; % draw image (...) ... ; % prescripts prepended to first, postscripts appended to last % draw decorated (...) ... ; % prescripts prepended to each, postscripts appended to each |