From af172a8db5f7583d0117635edde17eba5619d883 Mon Sep 17 00:00:00 2001
From: Context Git Mirror Bot <phg42.2a@gmail.com>
Date: Tue, 17 May 2016 10:29:20 +0200
Subject: 2016-05-17 10:11:00

---
 metapost/context/base/mpiv/mp-tool.mpiv | 12 ++++++++++++
 1 file changed, 12 insertions(+)

(limited to 'metapost')

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 =
-- 
cgit v1.2.3