summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
Diffstat (limited to 'metapost')
-rw-r--r--metapost/context/base/mpiv/mp-tool.mpiv12
1 files changed, 12 insertions, 0 deletions
diff --git a/metapost/context/base/mpiv/mp-tool.mpiv b/metapost/context/base/mpiv/mp-tool.mpiv
index f7959e673..76459d25c 100644
--- a/metapost/context/base/mpiv/mp-tool.mpiv
+++ b/metapost/context/base/mpiv/mp-tool.mpiv
@@ -837,6 +837,18 @@ vardef complementary expr c = (
fi c
) enddef ;
+vardef complemented expr c =
+ save m ;
+ if cmykcolor c : m := max(cyanpart c, magentapart c, yellowpart c, blackpart c) ;
+ ( (m,m,m,m) -
+ elseif rgbcolor c : m := max(redpart c, greenpart c, bluepart c) ;
+ ( (m,m,m) -
+ elseif pair c : m := max(xpart c, ypart c) ;
+ ( (m,m) -
+ elseif numeric c : ( m -
+ fi c )
+enddef ;
+
%D Well, this is the dangerous and naive version:
def drawfill text t =