summaryrefslogtreecommitdiff
path: root/metapost/context/base/mpiv/mp-tool.mpiv
diff options
context:
space:
mode:
Diffstat (limited to 'metapost/context/base/mpiv/mp-tool.mpiv')
-rw-r--r--metapost/context/base/mpiv/mp-tool.mpiv10
1 files changed, 9 insertions, 1 deletions
diff --git a/metapost/context/base/mpiv/mp-tool.mpiv b/metapost/context/base/mpiv/mp-tool.mpiv
index 7696eb372..f7959e673 100644
--- a/metapost/context/base/mpiv/mp-tool.mpiv
+++ b/metapost/context/base/mpiv/mp-tool.mpiv
@@ -822,13 +822,21 @@ def colortype(expr c) =
enddef ;
vardef whitecolor(expr c) =
- if cmykcolor c : (0,0,0,0) elseif rgbcolor c : (1,1,1) else : 1 fi
+ if cmykcolor c : (0,0,0,0) elseif rgbcolor c : (1,1,1) else : 1 fi
enddef ;
vardef blackcolor expr c =
if cmykcolor c : (0,0,0,1) elseif rgbcolor c : (0,0,0) else : 0 fi
enddef ;
+vardef complementary expr c = (
+ if cmykcolor c : (1,1,1,1) -
+ elseif rgbcolor c : (1,1,1) -
+ elseif pair c : (1,1) -
+ elseif numeric c : 1 -
+ fi c
+) enddef ;
+
%D Well, this is the dangerous and naive version:
def drawfill text t =