diff options
Diffstat (limited to 'Master/texmf-dist/doc/generic/pgf/version-for-tex4ht/en/pgfmanualse28.html')
-rw-r--r-- | Master/texmf-dist/doc/generic/pgf/version-for-tex4ht/en/pgfmanualse28.html | 773 |
1 files changed, 0 insertions, 773 deletions
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-tex4ht/en/pgfmanualse28.html b/Master/texmf-dist/doc/generic/pgf/version-for-tex4ht/en/pgfmanualse28.html deleted file mode 100644 index 861dcd26d8b..00000000000 --- a/Master/texmf-dist/doc/generic/pgf/version-for-tex4ht/en/pgfmanualse28.html +++ /dev/null @@ -1,773 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" - "http://www.w3.org/TR/html4/loose.dtd"> -<html > -<head><title>28 Declaring and Using Shadings</title> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -<meta name="generator" content="TeX4ht (http://www.cis.ohio-state.edu/~gurari/TeX4ht/mn.html)"> -<meta name="originator" content="TeX4ht (http://www.cis.ohio-state.edu/~gurari/TeX4ht/mn.html)"> -<!-- html --> -<meta name="src" content="pgfmanual.tex"> -<meta name="date" content="2005-11-15 18:41:00"> -<link rel="stylesheet" type="text/css" href="pgfmanual.css"> -</head><body -> - <div class="crosslinks"><p class="noindent">[<a -href="pgfmanualse29.html" >next</a>] [<a -href="pgfmanualse27.html" >prev</a>] [<a -href="pgfmanualse27.html#tailpgfmanualse27.html" >prev-tail</a>] [<a -href="#tailpgfmanualse28.html">tail</a>] [<a -href="pgfmanual.html#pgfmanualse28.html" >up</a>] </p></div> - <h3 class="sectionHead"><span class="titlemark">28 </span> <a - id="x29-28600028"></a>Declaring and Using Shadings</h3> -<!--l. 12--><p class="noindent"> - <h4 class="subsectionHead"><span class="titlemark">28.1 </span> <a - id="x29-28700028.1"></a>Overview</h4> -<!--l. 14--><p class="noindent">A shading is an area in which the color changes smoothly between different colors. Similarly to an image, a -shading must first be declared before it can be used. Also similarly to an image, a shading is put into a -<span class="TEX">T<span -class="E">E</span>X</span>-box. Hence, in order to include a shading in a <span class="obeylines-h"><span class="verb"><span -class="cmtt-10">{pgfpicture}</span></span></span>, you have to use <span class="obeylines-h"><span class="verb"><span -class="cmtt-10">\pgftext</span></span></span> around -it. -<!--l. 20--><p class="indent"> There are three kinds of shadings: horizontal, vertical, and radial shadings. However, you can rotate and clip -shadings like any other graphics object, which allows you to create more complicated shadings. Horizontal shadings -could be created by rotating a vertical shading by 90 degrees, but explicit commands for creating both horizontal -and vertical shadings are included for convenience. -<!--l. 27--><p class="indent"> Once you have declared a shading, you can insert it into text using the command <span class="obeylines-h"><span class="verb"><span -class="cmtt-10">\pgfuseshading</span></span></span>. This -command cannot be used directly in a <span class="obeylines-h"><span class="verb"><span -class="cmtt-10">{pgfpicture}</span></span></span>, you have to put a <span class="obeylines-h"><span class="verb"><span -class="cmtt-10">\pgftext</span></span></span> around it. The second command -for using shadings, <span class="obeylines-h"><span class="verb"><span -class="cmtt-10">\pgfshadepath</span></span></span>, on the other hand, can only be used inside <span class="obeylines-h"><span class="verb"><span -class="cmtt-10">{pgfpicture}</span></span></span> environments. It will -“fill” the current path with the shading. -<!--l. 34--><p class="indent"> A horizontal shading is a horizontal bar of a certain height whose color changes smoothly. You must at least -specify the colors at the left and at the right end of the bar, but you can also add color specifications for points in -between. For example, suppose you which to create a bar that is red at the left end, green in the -middle, and blue at the end. Suppose you would like the bar to be 4cm long. This could be specified as -follows: -<!--l. 41--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" -cellspacing="0" cellpadding="0" -frame="void" id="TBL-546-" ><colgroup id="TBL-546-1g"><col -id="TBL-546-1"></colgroup><tr - valign="baseline" id="TBL-546-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-546-1-1" -class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"><br><span -class="cmtt-8">rgb(0cm)=(1,0,0);</span><span -class="cmtt-8"> rgb(2cm)=(0,1,0);</span><span -class="cmtt-8"> rgb(4cm)=(0,0,1)</span> -</div> </td></tr></table> </td> -</tr></table> -</div> -<!--l. 44--><p class="indent"> This line means that at 0cm (the left end) of the bar, the color should be red, which has red-green-blue (rgb) -components (1,0,0). At 2cm, the bar should be green, and at 4cm it should be blue. Instead of <span class="obeylines-h"><span class="verb"><span -class="cmtt-10">rgb</span></span></span>, you can -currently also specify <span class="obeylines-h"><span class="verb"><span -class="cmtt-10">gray</span></span></span> as color model, in which case only one value is needed, or <span class="obeylines-h"><span class="verb"><span -class="cmtt-10">color</span></span></span>, in which case you must -provide the name of a color in parentheses. In a color specification the individual specifications must be separated -using a semicolon, which may be followed by a whitespace (like a space or a newline). Individual specifications must -be given in increasing order. -<!--l. 55--><p class="noindent"> - <h4 class="subsectionHead"><span class="titlemark">28.2 </span> <a - id="x29-28800028.2"></a>Declaring Shadings</h4> -<!--l. 58--><p class="noindent"> - <dl class="description"><dt class="description"> -<span -class="colorbox" id="colorbox357"><span -class="cmtt-10">\pgfdeclarehorizontalshading</span><span -class="cmtt-10">[</span><span -class="cmsy-10"><</span><span -class="cmti-10">color list</span><span -class="cmsy-10">></span><span -class="cmtt-10">]{</span><span -class="cmsy-10"><</span><span -class="cmti-10">shading name</span><span -class="cmsy-10">></span><span -class="cmtt-10">}{</span><span -class="cmsy-10"><</span><span -class="cmti-10">shading height</span><span -class="cmsy-10">></span><span -class="cmtt-10">}{</span><span -class="cmsy-10"><</span><span -class="cmti-10">color specification</span><span -class="cmsy-10">></span><span -class="cmtt-10">}</span></span> </dt><dd -class="description"> -<a - id="dx29-288001"></a> - <!--l. 59--><p class="noindent">Declares a horizontal shading named <span -class="cmsy-10"><</span><span -class="cmti-10">shading name</span><span -class="cmsy-10">> </span>of the specified <span -class="cmsy-10"><</span><span -class="cmti-10">height</span><span -class="cmsy-10">> </span>with the specified colors. - The length of the bar is deduced automatically from the maximum dimension in the specification. - <!--l. 63--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" -cellspacing="0" cellpadding="0" -frame="void" id="TBL-547-" ><colgroup id="TBL-547-1g"><col -id="TBL-547-1"><col -id="TBL-547-2"></colgroup><tr - valign="baseline" id="TBL-547-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-547-1-1" -class="td11"> <object data="pgfmanual-624.svg" width="152.74744 " height="38.93684 " type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-547-1-2" -class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> -<br><span -class="cmtt-8">\pgfdeclarehorizontalshading{myshadingA}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> {1cm}{rgb(0cm)=(1,0,0);</span><span -class="cmtt-8"> color(2cm)=(green);</span><span -class="cmtt-8"> color(4cm)=(blue)}</span> -<br><span -class="cmtt-8">\pgfuseshading{myshadingA}</span></div> </td></tr></table> </td> -</tr></table></div> - <!--l. 69--><p class="noindent">The effect of the <span -class="cmsy-10"><</span><span -class="cmti-10">color list</span><span -class="cmsy-10">></span>, which is a comma-separated list of colors, is the following: Normally, when this - list is empty, once a shading has been declared, it becomes “frozen.” This means that even if you change a - color that was used in the declaration of the shading later on, the shading will not change. By specifying a - - - <span -class="cmsy-10"><</span><span -class="cmti-10">color list</span><span -class="cmsy-10">> </span>you can specify that the shading should be recalculated whenever one of the colors listed in - the list changes (this includes effects like color mixins). Thus, when you specify a <span -class="cmsy-10"><</span><span -class="cmti-10">color list</span><span -class="cmsy-10">></span>, - whenever the shading is used, <span -class="cmcsc-10"><small -class="small-caps">P</small><small -class="small-caps">G</small><small -class="small-caps">F</small></span> first converts the colors in the list to <span -class="cmcsc-10"><small -class="small-caps">R</small><small -class="small-caps">G</small><small -class="small-caps">B</small> </span>triples using the - current values of the colors and taking any mixins and blends into account. If the resulting <span -class="cmcsc-10"><small -class="small-caps">R</small><small -class="small-caps">G</small><small -class="small-caps">B</small></span> - triples have not yet been used, a new shading is internally created and used. Note that if the - option <span -class="cmsy-10"><</span><span -class="cmti-10">color list</span><span -class="cmsy-10">> </span>is used, then no shading is created until the first use of <span class="obeylines-h"><span class="verb"><span -class="cmtt-10">\pgfuseshading</span></span></span>. - In particular, the colors mentioned in the shading need not be defined when the declaration is - given. - <!--l. 88--><p class="noindent">When a shading is recalculated because of a change in the colors mentioned in <span -class="cmsy-10"><</span><span -class="cmti-10">color list</span><span -class="cmsy-10">></span>, the complete - shading is recalculated. Thus even colors not mentioned in the list will be used with their current values, not - with the values they had upon declaration. - <!--l. 94--><p class="noindent"><div class="obeylines-v"></div> <object data="pgfmanual-625.svg" width="76.8737 " height="38.93684 " type="image/svg+xml"><p>SVG-Viewer needed.</p></object> <object data="pgfmanual-626.svg" width="76.8737 " height="38.93684 " type="image/svg+xml"><p>SVG-Viewer needed.</p></object><!--tex4ht:inline--><div class="tabular"><table class="tabular" -cellspacing="0" cellpadding="0" -frame="void" id="TBL-548-" ><colgroup id="TBL-548-1g"><col -id="TBL-548-1"></colgroup><tr - valign="baseline" id="TBL-548-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-548-1-1" -class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> -<br><span -class="cmtt-8">\pgfdeclarehorizontalshading[mycolor]{myshadingB}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> {1cm}{rgb(0cm)=(1,0,0);</span><span -class="cmtt-8"> color(2cm)=(mycolor)}</span> -<br><span -class="cmtt-8">\colorlet{mycolor}{green}</span> -<br><span -class="cmtt-8">\pgfuseshading{myshadingB}</span> -<br><span -class="cmtt-8">\colorlet{mycolor}{blue}</span> -<br><span -class="cmtt-8">\pgfuseshading{myshadingB}</span></div> </td></tr></table> </td> -</tr></table></div> - </dd></dl> -<!--l. 106--><p class="noindent"> - <dl class="description"><dt class="description"> -<span -class="colorbox" id="colorbox358"><span -class="cmtt-10">\pgfdeclareverticalshading</span><span -class="cmtt-10">[</span><span -class="cmsy-10"><</span><span -class="cmti-10">color list</span><span -class="cmsy-10">></span><span -class="cmtt-10">]{</span><span -class="cmsy-10"><</span><span -class="cmti-10">shading name</span><span -class="cmsy-10">></span><span -class="cmtt-10">}{</span><span -class="cmsy-10"><</span><span -class="cmti-10">shading width</span><span -class="cmsy-10">></span><span -class="cmtt-10">}{</span><span -class="cmsy-10"><</span><span -class="cmti-10">color specification</span><span -class="cmsy-10">></span><span -class="cmtt-10">}</span></span> </dt><dd -class="description"> -<a - id="dx29-288002"></a> - <!--l. 107--><p class="noindent">Declares a vertical shading named <span -class="cmsy-10"><</span><span -class="cmti-10">shading name</span><span -class="cmsy-10">> </span>of the specified <span -class="cmsy-10"><</span><span -class="cmti-10">width</span><span -class="cmsy-10">></span>. The height of the bar is - deduced automatically. The effect of <span -class="cmsy-10"><</span><span -class="cmti-10">color list</span><span -class="cmsy-10">> </span>is the same as for horizontal shadings. - <!--l. 112--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"> -<table class="tabular" -cellspacing="0" cellpadding="0" -frame="void" id="TBL-549-" ><colgroup id="TBL-549-1g"><col -id="TBL-549-1"><col -id="TBL-549-2"></colgroup><tr - valign="baseline" id="TBL-549-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-549-1-1" -class="td11"> <object data="pgfmanual-627.svg" width="152.74744 " height="76.8737 " type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-549-1-2" -class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> -<br><span -class="cmtt-8">\pgfdeclareverticalshading{myshadingC}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> {4cm}{rgb(0cm)=(1,0,0);</span><span -class="cmtt-8"> rgb(1.5cm)=(0,1,0);</span><span -class="cmtt-8"> rgb(2cm)=(0,0,1)}</span> -<br><span -class="cmtt-8">\pgfuseshading{myshadingC}</span></div> </td></tr></table> </td> -</tr></table></div> - </dd></dl> -<!--l. 121--><p class="noindent"> - <dl class="description"><dt class="description"> -<span -class="colorbox" id="colorbox359"><span -class="cmtt-10">\pgfdeclareradialshading</span><span -class="cmtt-10">[</span><span -class="cmsy-10"><</span><span -class="cmti-10">color list</span><span -class="cmsy-10">></span><span -class="cmtt-10">]{</span><span -class="cmsy-10"><</span><span -class="cmti-10">shading name</span><span -class="cmsy-10">></span><span -class="cmtt-10">}{</span><span -class="cmsy-10"><</span><span -class="cmti-10">center point</span><span -class="cmsy-10">></span><span -class="cmtt-10">}{</span><span -class="cmsy-10"><</span><span -class="cmti-10">color specification</span><span -class="cmsy-10">></span><span -class="cmtt-10">}</span></span> </dt><dd -class="description"> -<a - id="dx29-288003"></a> - <!--l. 122--><p class="noindent">Declares an radial shading. A radial shading is a circle whose inner color changes as specified by the - color specification. Assuming that the center of the shading is at the origin, the color of the center - will be the color specified for 0cm and the color of the border of the circle will be the color for the - maximum dimension given in the <span -class="cmsy-10"><</span><span -class="cmti-10">color specified</span><span -class="cmsy-10">></span>. This maximum will also be the radius of the circle. - If the <span -class="cmsy-10"><</span><span -class="cmti-10">center point</span><span -class="cmsy-10">> </span>is not at the origin, the whole shading inside the circle (whose size remains exactly - the same) will be distorted such that the given center now has the color specified for 0cm. The effect - of <span -class="cmsy-10"><</span><span -class="cmti-10">color list</span><span -class="cmsy-10">> </span>is the same as for horizontal shadings. - <!--l. 134--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" -cellspacing="0" cellpadding="0" -frame="void" id="TBL-550-" ><colgroup id="TBL-550-1g"><col -id="TBL-550-1"><col -id="TBL-550-2"></colgroup><tr - valign="baseline" id="TBL-550-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-550-1-1" -class="td11"> <object data="pgfmanual-628.svg" width="80.66762 " height="80.66762 " type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-550-1-2" -class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"><br><span -class="cmtt-8">\pgfdeclareradialshading{sphere}{\pgfpoint{0.5cm}{0.5cm}}</span><span -class="cmsltt-10x-x-80">%</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> {rgb(0cm)=(0.9,0,0);</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> </span><span -class="cmtt-8"> rgb(0.7cm)=(0.7,0,0);</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> </span><span -class="cmtt-8"> rgb(1cm)=(0.5,0,0);</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> </span><span -class="cmtt-8"> rgb(1.05cm)=(1,1,1)}</span> -<br><span -class="cmtt-8">\pgfuseshading{sphere}</span></div> </td></tr></table> </td> -</tr></table></div> - - - </dd></dl> -<!--l. 145--><p class="noindent"> - <h4 class="subsectionHead"><span class="titlemark">28.3 </span> <a - id="x29-28900028.3"></a>Using Shadings</h4> -<!--l. 148--><p class="noindent"> - <dl class="description"><dt class="description"> -<span -class="colorbox" id="colorbox360"><span -class="cmtt-10">\pgfuseshading</span><span -class="cmtt-10">{</span><span -class="cmsy-10"><</span><span -class="cmti-10">shading name</span><span -class="cmsy-10">></span><span -class="cmtt-10">}</span></span> </dt><dd -class="description"> -<a - id="dx29-289001"></a> - <!--l. 149--><p class="noindent">Inserts a previously declared shading into the text. If you wish to use it in a <span class="obeylines-h"><span class="verb"><span -class="cmtt-10">pgfpicture</span></span></span> environment, - you should put a <span class="obeylines-h"><span class="verb"><span -class="cmtt-10">\pgfbox</span></span></span> around it. - <!--l. 153--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" -cellspacing="0" cellpadding="0" -frame="void" id="TBL-551-" ><colgroup id="TBL-551-1g"><col -id="TBL-551-1"><col -id="TBL-551-2"></colgroup><tr - valign="baseline" id="TBL-551-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-551-1-1" -class="td11"> <object data="pgfmanual-631.svg" width="70.04785 " height="46.63496 " type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-551-1-2" -class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> -<br><span -class="cmtt-8">\begin{pgfpicture}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfdeclareverticalshading{myshadingD}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> </span><span -class="cmtt-8"> </span><span -class="cmtt-8"> {20pt}{color(0pt)=(red);</span><span -class="cmtt-8"> color(20pt)=(blue)}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgftext[at=\pgfpoint{1cm}{0cm}]</span><span -class="cmtt-8"> </span><span -class="cmtt-8"> {\pgfuseshading{myshadingD}}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgftext[at=\pgfpoint{2cm}{0.5cm}]{\pgfuseshading{myshadingD}}</span> -<br><span -class="cmtt-8">\end{pgfpicture}</span></div> </td></tr></table> </td> -</tr></table></div> - </dd></dl> -<!--l. 163--><p class="noindent"> - <dl class="description"><dt class="description"> -<span -class="colorbox" id="colorbox361"><span -class="cmtt-10">\pgfshadepath</span><span -class="cmtt-10">{</span><span -class="cmsy-10"><</span><span -class="cmti-10">shading name</span><span -class="cmsy-10">></span><span -class="cmtt-10">}{</span><span -class="cmsy-10"><</span><span -class="cmti-10">angle</span><span -class="cmsy-10">></span><span -class="cmtt-10">}</span></span> </dt><dd -class="description"> -<a - id="dx29-289002"></a> - <!--l. 164--><p class="noindent">This command must be used inside a <span class="obeylines-h"><span class="verb"><span -class="cmtt-10">{pgfpicture}</span></span></span> environment. The effect is a bit complex, so let - us go over it step by step. - <!--l. 167--><p class="noindent">First, <span -class="cmcsc-10"><small -class="small-caps">P</small><small -class="small-caps">G</small><small -class="small-caps">F</small></span> will setup a local scope. - <!--l. 169--><p class="noindent">Second, it uses the current path to clip everything inside this scope. However, the current path is once - more available after the scope, so it can be used, for example, to stroke it. - <!--l. 173--><p class="noindent">Now, the <span -class="cmsy-10"><</span><span -class="cmti-10">shading name</span><span -class="cmsy-10">> </span>should be a shading whose width and height are 100 bp, that is, 100 big - points. <span -class="cmcsc-10"><small -class="small-caps">P</small><small -class="small-caps">G</small><small -class="small-caps">F</small></span> has a look at the bounding box of the current path. This bounding box is computed - automatically when a path is computed; however, it can sometimes be (quite a bit) too large, especially - when complicated curves are involved. - <!--l. 180--><p class="noindent">Inside the scope, the low-level transformation matrix is modified. The center of the shading is translated - (moved) such that it lies on the center of the bounding box of the path. The low-level coordinate - system is also scaled such that the shading “covers” the shading (the details are a bit more complex, - see below). Finally, the coordinate system is rotated by <span -class="cmsy-10"><</span><span -class="cmti-10">angle</span><span -class="cmsy-10">></span>. - <!--l. 187--><p class="noindent">After everything has been set up, the shading is inserted. Due to the transformations and clippings, - the effect will be that the shading seems to “fill” the path. - <!--l. 191--><p class="noindent">If both the path and the shadings were always rectangles and if rotation were never involved, it would - be easy to scale shadings such they always cover the path. However, when a vertical shading is rotated, - it must obviously be “magnified” so that it still covers the path. Things get worse when the path is - not a rectangle itself. - <!--l. 198--><p class="noindent">For these reasons, things work slightly differently “in reality.” The shading is scaled and translated - such that the the point (50bp<span -class="cmmi-10">,</span>50bp), which is the middle of the shading, is at the middle of the path - and such that the the point (25bp<span -class="cmmi-10">,</span>25bp) is at the lower left corner of the path and that (75bp<span -class="cmmi-10">,</span>75bp) - is at upper right corner. - <!--l. 206--><p class="noindent">In other words, only the center quarter of the shading will actually “survive the clipping” if the path - is a rectangle. If the path is not a rectangle, but, say, a circle, even less is seen of the shading. Here is - an example that demonstrates this effect: - - - <!--l. 211--><p class="noindent"><div class="obeylines-v"></div> <object data="pgfmanual-632.svg" width="134.83281 " height="134.83281 " type="image/svg+xml"><p>SVG-Viewer needed.</p></object> <object data="pgfmanual-633.svg" width="380.90193 " height="77.40703 " type="image/svg+xml"><p>SVG-Viewer needed.</p></object><!--tex4ht:inline--><div class="tabular"><table class="tabular" -cellspacing="0" cellpadding="0" -frame="void" id="TBL-552-" ><colgroup id="TBL-552-1g"><col -id="TBL-552-1"></colgroup><tr - valign="baseline" id="TBL-552-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-552-1-1" -class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> -<br><span -class="cmtt-8">\pgfdeclareverticalshading{myshadingE}{100bp}</span> -<br><span -class="cmtt-8"> {color(0bp)=(red);</span><span -class="cmtt-8"> color(25bp)=(green);</span><span -class="cmtt-8"> </span><span -class="cmtt-8"> color(75bp)=(blue);</span><span -class="cmtt-8"> </span><span -class="cmtt-8"> color(100bp)=(black)}</span> -<br><span -class="cmtt-8">\pgfuseshading{myshadingE}</span> -<br><span -class="cmtt-8">\hskip</span><span -class="cmtt-8"> 1cm</span> -<br><span -class="cmtt-8">\begin{pgfpicture}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2cm}{1cm}}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfshadepath{myshadingE}{0}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfusepath{stroke}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfpathrectangle{\pgfpoint{3cm}{0cm}}{\pgfpoint{1cm}{2cm}}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfshadepath{myshadingE}{0}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfusepath{stroke}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfpathrectangle{\pgfpoint{5cm}{0cm}}{\pgfpoint{2cm}{2cm}}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfshadepath{myshadingE}{45}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfusepath{stroke}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfpathcircle{\pgfpoint{9cm}{1cm}}{1cm}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfshadepath{myshadingE}{45}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfusepath{stroke}</span> -<br><span -class="cmtt-8">\end{pgfpicture}</span></div> </td></tr></table> </td> -</tr></table> - </div> - <!--l. 232--><p class="noindent">As can be seen above in the last case, the “hidden” part of the shading actually <span -class="cmti-10">can </span>become visible if the - shading is rotated. The reason is that it is scaled as if no rotation took place, then the rotation is - done. - <!--l. 237--><p class="noindent">The following graphics show which part of the shading are actually shown: - <!--l. 240--><p class="noindent"><div class="obeylines-v"></div> <object data="pgfmanual-637.svg" width="527.53375 " height="160.28314 " type="image/svg+xml"><p>SVG-Viewer needed.</p></object><!--tex4ht:inline--><div class="tabular"><table class="tabular" -cellspacing="0" cellpadding="0" -frame="void" id="TBL-553-" ><colgroup id="TBL-553-1g"><col -id="TBL-553-1"></colgroup><tr - valign="baseline" id="TBL-553-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-553-1-1" -class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> -<br><span -class="cmtt-8">\pgfdeclareverticalshading{myshadingF}{100bp}</span> -<br><span -class="cmtt-8"> {color(0bp)=(red);</span><span -class="cmtt-8"> color(25bp)=(green);</span><span -class="cmtt-8"> </span><span -class="cmtt-8"> color(75bp)=(blue);</span><span -class="cmtt-8"> </span><span -class="cmtt-8"> color(100bp)=(black)}</span> -<br><span -class="cmtt-8">\begin{tikzpicture}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \draw</span><span -class="cmtt-8"> (50bp,50bp)</span><span -class="cmtt-8"> node</span><span -class="cmtt-8"> {\pgfuseshading{myshadingF}};</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \draw[white,thick]</span><span -class="cmtt-8"> (25bp,25bp)</span><span -class="cmtt-8"> rectangle</span><span -class="cmtt-8"> (75bp,75bp);</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \draw</span><span -class="cmtt-8"> (50bp,0bp)</span><span -class="cmtt-8"> node[below]</span><span -class="cmtt-8"> {first</span><span -class="cmtt-8"> two</span><span -class="cmtt-8"> applications};</span> -<br> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \begin{scope}[xshift=5cm]</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> </span><span -class="cmtt-8"> </span><span -class="cmtt-8"> \draw</span><span -class="cmtt-8"> (50bp,50bp)</span><span -class="cmtt-8"> node{\pgfuseshading{myshadingF}};</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> </span><span -class="cmtt-8"> </span><span -class="cmtt-8"> \draw[rotate</span><span -class="cmtt-8"> around={45:(50bp,50bp)},white,thick]</span><span -class="cmtt-8"> (25bp,25bp)</span><span -class="cmtt-8"> rectangle</span><span -class="cmtt-8"> (75bp,75bp);</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> </span><span -class="cmtt-8"> </span><span -class="cmtt-8"> \draw</span><span -class="cmtt-8"> (50bp,0bp)</span><span -class="cmtt-8"> node[below]</span><span -class="cmtt-8"> {third</span><span -class="cmtt-8"> application};</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \end{scope}</span> -<br> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \begin{scope}[xshift=10cm]</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> </span><span -class="cmtt-8"> </span><span -class="cmtt-8"> \draw</span><span -class="cmtt-8"> (50bp,50bp)</span><span -class="cmtt-8"> node{\pgfuseshading{myshadingF}};</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> </span><span -class="cmtt-8"> </span><span -class="cmtt-8"> \draw[white,thick]</span><span -class="cmtt-8"> (50bp,50bp)</span><span -class="cmtt-8"> circle</span><span -class="cmtt-8"> (25bp);</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> </span><span -class="cmtt-8"> </span><span -class="cmtt-8"> \draw</span><span -class="cmtt-8"> (50bp,0bp)</span><span -class="cmtt-8"> node[below]</span><span -class="cmtt-8"> {fourth</span><span -class="cmtt-8"> application};</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \end{scope}</span> -<br><span -class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> -</tr></table> - </div> - <!--l. 262--><p class="noindent">An advantage of this approach is that when you rotate a radial shading, no distortion is introduced: - - - <!--l. 265--><p class="noindent"><div class="obeylines-v"></div> <object data="pgfmanual-638.svg" width="134.83281 " height="134.83281 " type="image/svg+xml"><p>SVG-Viewer needed.</p></object> <object data="pgfmanual-639.svg" width="266.558 " height="76.87369 " type="image/svg+xml"><p>SVG-Viewer needed.</p></object><!--tex4ht:inline--><div class="tabular"><table class="tabular" -cellspacing="0" cellpadding="0" -frame="void" id="TBL-554-" ><colgroup id="TBL-554-1g"><col -id="TBL-554-1"></colgroup><tr - valign="baseline" id="TBL-554-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-554-1-1" -class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> -<br><span -class="cmtt-8">\pgfdeclareradialshading{ballshading}{\pgfpoint{-10bp}{10bp}}</span> -<br><span -class="cmtt-8"> {color(0bp)=(red!15!white);</span><span -class="cmtt-8"> color(9bp)=(red!75!white);</span> -<br><span -class="cmtt-8"> color(18bp)=(red!70!black);</span><span -class="cmtt-8"> color(25bp)=(red!50!black);</span><span -class="cmtt-8"> color(50bp)=(black)}</span> -<br><span -class="cmtt-8">\pgfuseshading{ballshading}</span> -<br><span -class="cmtt-8">\hskip</span><span -class="cmtt-8"> 1cm</span> -<br><span -class="cmtt-8">\begin{pgfpicture}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{1cm}{1cm}}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfshadepath{ballshading}{0}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfusepath{}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfpathcircle{\pgfpoint{3cm}{0cm}}{1cm}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfshadepath{ballshading}{0}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfusepath{}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfpathcircle{\pgfpoint{6cm}{0cm}}{1cm}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfshadepath{ballshading}{45}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfusepath{}</span> -<br><span -class="cmtt-8">\end{pgfpicture}</span></div> </td></tr></table> </td> -</tr></table> - </div> - <!--l. 284--><p class="noindent">If you specify a rotation of 90<sup ><span -class="cmsy-7"><span class="htf-cmbx">o</span></span></sup> and if the path is not a square, but an elongated rectangle, the “desired” effect - results: The shading will exactly vary between the colors at the 25bp and 75bp boundaries. Here is an - example: - <!--l. 289--><p class="noindent"><div class="obeylines-v"></div> <object data="pgfmanual-640.svg" width="305.02818 " height="39.47017 " type="image/svg+xml"><p>SVG-Viewer needed.</p></object><!--tex4ht:inline--><div class="tabular"><table class="tabular" -cellspacing="0" cellpadding="0" -frame="void" id="TBL-555-" ><colgroup id="TBL-555-1g"><col -id="TBL-555-1"></colgroup><tr - valign="baseline" id="TBL-555-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-555-1-1" -class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> -<br><span -class="cmtt-8">\pgfdeclareverticalshading{myshadingG}{100bp}</span> -<br><span -class="cmtt-8"> {color(0bp)=(red);</span><span -class="cmtt-8"> color(25bp)=(green);</span><span -class="cmtt-8"> </span><span -class="cmtt-8"> color(75bp)=(blue);</span><span -class="cmtt-8"> </span><span -class="cmtt-8"> color(100bp)=(black)}</span> -<br><span -class="cmtt-8">\begin{pgfpicture}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2cm}{1cm}}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfshadepath{myshadingG}{0}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfusepath{stroke}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfpathrectangle{\pgfpoint{3cm}{0cm}}{\pgfpoint{2cm}{1cm}}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfshadepath{myshadingG}{90}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfusepath{stroke}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfpathrectangle{\pgfpoint{6cm}{0cm}}{\pgfpoint{2cm}{1cm}}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfshadepath{myshadingG}{45}</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \pgfusepath{stroke}</span> -<br><span -class="cmtt-8">\end{pgfpicture}</span></div> </td></tr></table> </td> -</tr></table> - </div> - <!--l. 306--><p class="noindent">As a final example, let us define a “rainbow spectrum” shading for use with Ti<span -class="cmti-10">k</span>Z. - <!--l. 308--><p class="noindent"><div class="obeylines-v"></div><!--tex4ht:inline--><div class="tabular"><table class="tabular" -cellspacing="0" cellpadding="0" -frame="void" id="TBL-556-" ><colgroup id="TBL-556-1g"><col -id="TBL-556-1"><col -id="TBL-556-2"></colgroup><tr - valign="baseline" id="TBL-556-1-"><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-556-1-1" -class="td11"> <object data="pgfmanual-641.svg" width="152.74738 " height="76.87369 " type="image/svg+xml"><p>SVG-Viewer needed.</p></object> </td><td align="left" style="white-space:nowrap; text-align:left;" id="TBL-556-1-2" -class="td11"> <table class="minipage"><tr><td><div class="obeylines-v"> -<br><span -class="cmtt-8">\pgfdeclareverticalshading{rainbow}{100bp}</span> -<br><span -class="cmtt-8"> {color(0bp)=(red);</span><span -class="cmtt-8"> color(25bp)=(red);</span><span -class="cmtt-8"> color(35bp)=(yellow);</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> color(45bp)=(green);</span><span -class="cmtt-8"> color(55bp)=(cyan);</span><span -class="cmtt-8"> color(65bp)=(blue);</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> color(75bp)=(violet);</span><span -class="cmtt-8"> color(100bp)=(violet)}</span> -<br><span -class="cmtt-8">\begin{tikzpicture}[shading=rainbow]</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \shade</span><span -class="cmtt-8"> (0,0)</span><span -class="cmtt-8"> rectangle</span><span -class="cmtt-8"> node[white]</span><span -class="cmtt-8"> {\textsc{pride}}</span><span -class="cmtt-8"> (2,1);</span> -<br><span -class="cmtt-8"> </span><span -class="cmtt-8"> \shade[shading</span><span -class="cmtt-8"> angle=90]</span><span -class="cmtt-8"> (3,0)</span><span -class="cmtt-8"> rectangle</span><span -class="cmtt-8"> +(1,2);</span> -<br><span -class="cmtt-8">\end{tikzpicture}</span></div> </td></tr></table> </td> -</tr></table></div> - <!--l. 319--><p class="noindent">Note that rainbow shadings are <span -class="cmti-10">way </span>to colorful in almost all applications. </dd></dl> - - - - - - - <div class="crosslinks"><p class="noindent">[<a -href="pgfmanualse29.html" >next</a>] [<a -href="pgfmanualse27.html" >prev</a>] [<a -href="pgfmanualse27.html#tailpgfmanualse27.html" >prev-tail</a>] [<a -href="pgfmanualse28.html" >front</a>] [<a -href="pgfmanual.html#pgfmanualse28.html" >up</a>] </p></div> -<!--l. 8--><p class="indent"> <a - id="tailpgfmanualse28.html"></a> -</body></html> |