Changes

Jump to navigation Jump to search
1,200 bytes added ,  20:09, 13 July 2005
m
Changed transparency example slightly to show order of drawing.
=Transparent Colors=
As mentioned earlier, transparent colors can be produced by setting the <tt>t</tt> value for the color. Hans Hagen posted the following sample code for transparent colors on the mailing list on 2005-07-13; the yellow blocks have been added to demonstrate the order in which the blocks are drawn on the page; the first yellow block is behind the transparent red and blue blocks, while the second is in front of them.
<texcode>
\setupcolors[state=start]
\definecolor [transparentred] [r=1,t=.5,a=1]
\definecolor [transparentblue] [b=1,t=.5,a=1]
\definecolor [solidyellow] [y=1,t=1,a=1]
\starttext \startTEXpageThis is some sample text that goes behind the rectangles\hskip-8cm\blackrule[width=2cm,height=1cm,depth=1cm,color=solidyellow]\hskip-0.67cm\blackrule[width=2cm,height=2cm,color=transparentred]\hskip-0.67cm\blackrule[width=2cm,height=1cm,depth=1cm,color=transparentblue]\hskip-0.67cm\blackrule[width=2cm,height=2cm,color=solidyellow]\hskip2cm.\stopTEXpage \stoptext</texcode> <context>\setupcolors[state=start]\definecolor [luigitransparentred] [r=1,t=.5,a=1]\definecolor [scarsotransparentblue] [b=1,t=.5,a=1]\definecolor [solidyellow] [y=1,t=1,a=1]
\starttext
\startTEXpage
This is some sample text that goes behind the rectangles\hskip-8cm\blackrule[width=2cm,height=1cm,depth=1cm,color=solidyellow]\hskip-0.67cm\blackrule[width=2cm,height=2cm,color=luigitransparentred]\hskip-0.67cm\blackrule[width=2cm,height=1cm,depth=1cm,color=transparentblue]\hskip-0.67cm\blackrule[width=2cm,height=2cm,color=scarsosolidyellow]\hskip2cm.
\stopTEXpage
\stoptext
</texcodecontext>

Navigation menu