diff options
author | Taco Hoekwater <taco@elvenkind.com> | 2011-06-01 08:54:21 +0000 |
---|---|---|
committer | Taco Hoekwater <taco@elvenkind.com> | 2011-06-01 08:54:21 +0000 |
commit | d7ccb42582f85acf30568913610ccf4d602023fb (patch) | |
tree | 7292e3545a420676878e7451b68892d360c62cb6 /Master/texmf-dist/tex/context/base/attr-col.mkiv | |
parent | 2d62a6fe9b80def59c392268022f1f9a2d6e358f (diff) |
commit context 2011.05.18
git-svn-id: svn://tug.org/texlive/trunk@22719 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/attr-col.mkiv')
-rw-r--r-- | Master/texmf-dist/tex/context/base/attr-col.mkiv | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/base/attr-col.mkiv b/Master/texmf-dist/tex/context/base/attr-col.mkiv new file mode 100644 index 00000000000..8d61ee8aeff --- /dev/null +++ b/Master/texmf-dist/tex/context/base/attr-col.mkiv @@ -0,0 +1,82 @@ +%D \module +%D [ file=attr-col, +%D version=2007.06.06, +%D title=\CONTEXT\ Attribute Macros, +%D subtitle=Color, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Attribute Macros / Color} + +\registerctxluafile{attr-col}{1.001} + +\unprotect + +% todo: no need for 'color' argument, we can set that once at startup; currently +% a bit inconsistent + +% 1=off 2=gray 3=spot 4=rgb 5=cmyk 6=cmy % only 1/2/4/5 are supported +% +% We could combine this in one attribute but this is not faster and also +% less flexible because sometimes we want to freeze the attribute bit. + +% % color (layer on top) +% +% \def\dosetcolormodel#1% overloaded later +% {\ctxcommand{setcolormodel('#1')}} % sets attribute +% +% \dosetcolormodel{all} +% +% \def\registerrgbcolor#1#2#3#4% not used +% {\setevalue{(cs:#1)}{\attribute\colorattribute\ctxcommand{registercolor('#1','rgb' ,#2,#3,#4)}}} +% +% \def\registercmykcolor#1#2#3#4#5% not used +% {\setevalue{(cs:#1)}{\attribute\colorattribute\ctxcommand{registercolor('#1','cmyk',#2,#3,#4,#5)}}} +% +% \def\registergraycolor#1#2% not used +% {\setevalue{(cs:#1)}{\attribute\colorattribute\ctxcommand{registercolor('#1','gray',#2)}}} + +% % transparency (layer on top) +% +% \def\registertransparency#1#2#3% +% {\setevalue{(ts:#1)}{\attribute\transparencyattribute\ctxcommand{registertransparency(#2,#3)} }} +% +% \def\sometransparencyswitch#1% +% {\csname(ts:#1)\endcsname} +% +% \def\sometransparencyswitch +% {\ctxcommand{enabletransparency()}% +% \gdef\sometransparencyswitch##1{\csname(ts:##1)\endcsname}% +% \sometransparencyswitch} +% +% \registertransparency {one} {1} {.5} +% \registertransparency {two} {1} {.6} + +% overprint + +\def\registercolorintent#1#2% + {\setevalue{(os:#1)}{\attribute\colorintentattribute\ctxcommand{registercolorintent('#2')} }} + +\def\dotriggercolorintent + {\ctxcommand{enablecolorintents()}% + \gdef\dotriggercolorintent##1{\csname(os:##1)\endcsname}% + \dotriggercolorintent} + +\registercolorintent{knockout} {knockout} +\registercolorintent{overprint}{overprint} + +\installattributestack\colorintentattribute + +\setevalue{(os:#\v!none}{\attribute\colorintentattribute\attributeunsetvalue} % does this work out ok? + +\protect \endinput + +% test case +% +% {\green \hbox to \hsize{\leaders\hrule \hfill a}\par} +% {\red \hbox to \hsize{\leaders\hbox{x}\hfill a}\par} |