summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2016-05-17 10:29:20 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-05-17 10:29:20 +0200
commitaf172a8db5f7583d0117635edde17eba5619d883 (patch)
tree50688f3516ce1a3e3d19922666d80101d473f124 /metapost
parentb344014638169aad6e5f6d2a9a703cb03a8b5064 (diff)
downloadcontext-af172a8db5f7583d0117635edde17eba5619d883.tar.gz
2016-05-17 10:11:00
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 =