summaryrefslogtreecommitdiff
path: root/tex/context/base/colo-ext.mkiv
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2009-11-01 21:24:00 +0100
committerHans Hagen <pragma@wxs.nl>2009-11-01 21:24:00 +0100
commite13c1d71259b390bbacfdbe45262091754bd71bc (patch)
treeaad0430edfc610c817f870bdd49c238b961ab848 /tex/context/base/colo-ext.mkiv
parenteab6a73597f38d58fc4d3cfc4fbddb7c3f6e1e8f (diff)
downloadcontext-e13c1d71259b390bbacfdbe45262091754bd71bc.tar.gz
beta 2009.11.01 21:24
Diffstat (limited to 'tex/context/base/colo-ext.mkiv')
-rw-r--r--tex/context/base/colo-ext.mkiv22
1 files changed, 22 insertions, 0 deletions
diff --git a/tex/context/base/colo-ext.mkiv b/tex/context/base/colo-ext.mkiv
index 074a0130e..f973af73a 100644
--- a/tex/context/base/colo-ext.mkiv
+++ b/tex/context/base/colo-ext.mkiv
@@ -75,4 +75,26 @@
\setupcolors[\c!intent=\v!none]
+% A goodie that replaces the startMPcolor hackery
+%
+% \definecolor[red-t] [r=1,t=0.5,a=1]
+% \definecolor[green-t][g=1,t=0.5,a=1]
+% \defineintermediatecolor[mycolora][0.5,red,green]
+% \defineintermediatecolor[mycolorb][0.5,red-t,green-t]
+% \starttext
+% test {\mycolora OEPS} test
+% test {\mycolorb OEPS} test
+% \stoptext
+
+\def\defineintermediatecolor
+ {\dodoubleempty\dodefineintermediatecolor}
+
+\def\dodefineintermediatecolor[#1][#2,#3,#4]% -- no checking
+ {\ifconditional\collectcolorsinlist\collectcolorinlist{#1}\fi
+ \ctxlua{colors.defineintermediate("#1",0#2,
+ \thecolorattribute{#3},\thecolorattribute{#4},
+ \thetransparencyattribute{#3},\thetransparencyattribute{#4},
+ \iffreezecolors true\else false\fi)}%
+ \dodefinecolorcommand\setvalue{#1}}
+
\protect \endinput