Debian Codegraph @

texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.code.tex

raw
1 % Copyright 2018 by Till Tantau
2 %
3 % This file may be distributed and/or modified
4 %
5 % 1. under the LaTeX Project Public License and/or
6 % 2. under the GNU Public License.
7 %
8 % See the file doc/generic/pgf/licenses/LICENSE for more details.
9
10 \ProvidesFileRCS{pgflibrarypatterns.code.tex}
11
12
13 % Lines in different directions
14
15 \pgfdeclarepatternformonly{horizontal lines}{\pgfpointorigin}{\pgfqpoint{100pt}{1pt}}{\pgfqpoint{100pt}{3pt}}%
16 {%
17 \pgfsetlinewidth{0.4pt}%
18 \pgfpathmoveto{\pgfqpoint{0pt}{0.5pt}}%
19 \pgfpathlineto{\pgfqpoint{100pt}{0.5pt}}%
20 \pgfusepath{stroke}%
21 }%
22
23 \pgfdeclarepatternformonly{vertical lines}{\pgfpointorigin}{\pgfqpoint{1pt}{100pt}}{\pgfqpoint{3pt}{100pt}}%
24 {%
25 \pgfsetlinewidth{0.4pt}%
26 \pgfpathmoveto{\pgfqpoint{0.5pt}{0pt}}%
27 \pgfpathlineto{\pgfqpoint{0.5pt}{100pt}}%
28 \pgfusepath{stroke}%
29 }%
30
31 \pgfdeclarepatternformonly{north east lines}{\pgfqpoint{-1pt}{-1pt}}{\pgfqpoint{4pt}{4pt}}{\pgfqpoint{3pt}{3pt}}%
32 {%
33 \pgfsetlinewidth{0.4pt}%
34 \pgfpathmoveto{\pgfqpoint{0pt}{0pt}}%
35 \pgfpathlineto{\pgfqpoint{3.1pt}{3.1pt}}%
36 \pgfusepath{stroke}%
37 }%
38
39 \pgfdeclarepatternformonly{north west lines}{\pgfqpoint{-1pt}{-1pt}}{\pgfqpoint{4pt}{4pt}}{\pgfqpoint{3pt}{3pt}}%
40 {%
41 \pgfsetlinewidth{0.4pt}%
42 \pgfpathmoveto{\pgfqpoint{0pt}{3pt}}%
43 \pgfpathlineto{\pgfqpoint{3.1pt}{-0.1pt}}%
44 \pgfusepath{stroke}%
45 }%
46
47 % Crossed lines in different directions
48
49 \pgfdeclarepatternformonly{grid}{\pgfqpoint{-1pt}{-1pt}}{\pgfqpoint{4pt}{4pt}}{\pgfqpoint{3pt}{3pt}}%
50 {%
51 \pgfsetlinewidth{0.4pt}%
52 \pgfpathmoveto{\pgfqpoint{0pt}{0pt}}%
53 \pgfpathlineto{\pgfqpoint{0pt}{3.1pt}}%
54 \pgfpathmoveto{\pgfqpoint{0pt}{0pt}}%
55 \pgfpathlineto{\pgfqpoint{3.1pt}{0pt}}%
56 \pgfusepath{stroke}%
57 }%
58
59 \pgfdeclarepatternformonly{crosshatch}{\pgfqpoint{-1pt}{-1pt}}{\pgfqpoint{4pt}{4pt}}{\pgfqpoint{3pt}{3pt}}%
60 {%
61 \pgfsetlinewidth{0.4pt}%
62 \pgfpathmoveto{\pgfqpoint{3.1pt}{0pt}}%
63 \pgfpathlineto{\pgfqpoint{0pt}{3.1pt}}%
64 \pgfpathmoveto{\pgfqpoint{0pt}{0pt}}%
65 \pgfpathlineto{\pgfqpoint{3.1pt}{3.1pt}}%
66 \pgfusepath{stroke}%
67 }%
68
69
70 % Dotted regions
71
72 \pgfdeclarepatternformonly{dots}{\pgfqpoint{-1pt}{-1pt}}{\pgfqpoint{1pt}{1pt}}{\pgfqpoint{3pt}{3pt}}%
73 {%
74 \pgfpathcircle{\pgfqpoint{0pt}{0pt}}{.5pt}%
75 \pgfusepath{fill}%
76 }%
77
78 \pgfdeclarepatternformonly{crosshatch dots}{\pgfqpoint{-1pt}{-1pt}}{\pgfqpoint{2.5pt}{2.5pt}}{\pgfqpoint{3pt}{3pt}}%
79 {%
80 \pgfpathcircle{\pgfqpoint{0pt}{0pt}}{.5pt}%
81 \pgfpathcircle{\pgfqpoint{1.5pt}{1.5pt}}{.5pt}%
82 \pgfusepath{fill}%
83 }%
84
85
86
87
88 % Star shaped patterns
89
90 \pgfdeclarepatternformonly{fivepointed stars}{\pgfpointorigin}{\pgfqpoint{3mm}{3mm}}{\pgfqpoint{3mm}{3mm}}%
91 {%
92 \pgftransformshift{\pgfqpoint{1mm}{1mm}}%
93 \pgfpathmoveto{\pgfqpointpolar{18}{1mm}}%
94 \pgfpathlineto{\pgfqpointpolar{162}{1mm}}%
95 \pgfpathlineto{\pgfqpointpolar{306}{1mm}}%
96 \pgfpathlineto{\pgfqpointpolar{90}{1mm}}%
97 \pgfpathlineto{\pgfqpointpolar{234}{1mm}}%
98 \pgfpathclose%%
99 \pgfusepath{fill}%
100 }%
101
102 \pgfdeclarepatternformonly{sixpointed stars}{\pgfpointorigin}{\pgfqpoint{3mm}{3mm}}{\pgfqpoint{3mm}{3mm}}%
103 {%
104 \pgftransformshift{\pgfqpoint{1mm}{1mm}}%
105 \pgfpathmoveto{\pgfqpointpolar{30}{1mm}}%
106 \pgfpathlineto{\pgfqpointpolar{150}{1mm}}%
107 \pgfpathlineto{\pgfqpointpolar{270}{1mm}}%
108 \pgfpathclose%
109 \pgfpathmoveto{\pgfqpointpolar{-30}{1mm}}%
110 \pgfpathlineto{\pgfqpointpolar{-270}{1mm}}%
111 \pgfpathlineto{\pgfqpointpolar{-150}{1mm}}%
112 \pgfpathclose%
113 \pgfsetnonzerorule%
114 \pgfusepath{fill}%
115 }%
116
117
118
119 % Bricks
120
121 \pgfdeclarepatternformonly{bricks}{\pgfqpoint{-1pt}{-1pt}}{\pgfqpoint{5mm}{5mm}}{\pgfqpoint{4mm}{4mm}}%
122 {%
123 \pgfsetlinewidth{0.8pt}%
124 \pgfpathmoveto{\pgfqpoint{0mm}{1mm}}%
125 \pgfpathlineto{\pgfqpoint{4mm}{1mm}}%
126 \pgfpathmoveto{\pgfqpoint{0mm}{3mm}}%
127 \pgfpathlineto{\pgfqpoint{4mm}{3mm}}%
128 \pgfpathmoveto{\pgfqpoint{1mm}{0mm}}%
129 \pgfpathlineto{\pgfqpoint{1mm}{1mm}}%
130 \pgfpathmoveto{\pgfqpoint{3mm}{1mm}}%
131 \pgfpathlineto{\pgfqpoint{3mm}{3mm}}%
132 \pgfpathmoveto{\pgfqpoint{1mm}{3mm}}%
133 \pgfpathlineto{\pgfqpoint{1mm}{4mm}}%
134 \pgfusepath{stroke}%
135 }%
136
137
138 % Checkerboards
139
140 \pgfdeclarepatternformonly{checkerboard}{\pgfpointorigin}{\pgfqpoint{4mm}{4mm}}{\pgfqpoint{4mm}{4mm}}%
141 {%
142 \pgfpathrectangle{\pgfpointorigin}{\pgfqpoint{2mm}{2mm}}%
143 \pgfpathrectangle{\pgfqpoint{2mm}{2mm}}{\pgfqpoint{2mm}{2mm}}%
144 \pgfusepath{fill}%
145 }%
146
147
148
149 % Backgrounds
150
151 \pgfdeclarepatterninherentlycolored{checkerboard light gray}
152 {\pgfpointorigin}{\pgfqpoint{4mm}{4mm}}{\pgfqpoint{4mm}{4mm}}%
153 {%
154 % \pgfsetfillcolor{black!10}
155 \pgfpathrectangle{\pgfpointorigin}{\pgfqpoint{4.1mm}{4.1mm}}% make
156 % slightly larger to ensure that tiles
157 % are really solid
158 \pgfusepath{fill}%
159 \pgfsetfillcolor{black!20}%
160 \pgfpathrectangle{\pgfpointorigin}{\pgfqpoint{2mm}{2mm}}%
161 \pgfpathrectangle{\pgfqpoint{2mm}{2mm}}{\pgfqpoint{2mm}{2mm}}%
162 \pgfusepath{fill}%
163 }%
164
165 \pgfdeclarepatterninherentlycolored{horizontal lines light gray}
166 {\pgfpointorigin}{\pgfpoint{100pt}{4pt}}
167 {\pgfpoint{100pt}{4pt}}
168 {%
169 \pgfsetfillcolor{black!10}%
170 \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{100pt}{2.5pt}}%
171 \pgfusepath{fill}%
172 \pgfsetfillcolor{black!15}%
173 \pgfpathrectangle{\pgfpoint{0pt}{2pt}}{\pgfpoint{100pt}{2.5pt}}%
174 \pgfusepath{fill}%
175 }%
176
177 \pgfdeclarepatterninherentlycolored{horizontal lines gray}
178 {\pgfpointorigin}{\pgfpoint{100pt}{4pt}}
179 {\pgfpoint{100pt}{4pt}}
180 {%
181 \pgfsetfillcolor{black!30}%
182 \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{100pt}{2.5pt}}%
183 \pgfusepath{fill}%
184 \pgfsetfillcolor{black!35}%
185 \pgfpathrectangle{\pgfpoint{0pt}{2pt}}{\pgfpoint{100pt}{2.5pt}}%
186 \pgfusepath{fill}%
187 }%
188
189 \pgfdeclarepatterninherentlycolored{horizontal lines dark gray}
190 {\pgfpointorigin}{\pgfpoint{100pt}{4pt}}
191 {\pgfpoint{100pt}{4pt}}
192 {%
193 \pgfsetfillcolor{black!90}%
194 \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{100pt}{2.5pt}}%
195 \pgfusepath{fill}%
196 \pgfsetfillcolor{black!85}%
197 \pgfpathrectangle{\pgfpoint{0pt}{2pt}}{\pgfpoint{100pt}{2.5pt}}%
198 \pgfusepath{fill}%
199 }%
200
201 \pgfdeclarepatterninherentlycolored{horizontal lines light blue}
202 {\pgfpointorigin}{\pgfpoint{100pt}{4pt}}
203 {\pgfpoint{100pt}{4pt}}
204 {%
205 \pgfsetfillcolor{blue!10}%
206 \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{100pt}{2.5pt}}%
207 \pgfusepath{fill}%
208 \pgfsetfillcolor{blue!15}%
209 \pgfpathrectangle{\pgfpoint{0pt}{2pt}}{\pgfpoint{100pt}{2.5pt}}%
210 \pgfusepath{fill}%
211 }%
212
213 \pgfdeclarepatterninherentlycolored{horizontal lines dark blue}
214 {\pgfpointorigin}{\pgfpoint{100pt}{4pt}}
215 {\pgfpoint{100pt}{4pt}}
216 {%
217 \pgfsetfillcolor{blue!90}%
218 \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{100pt}{2.5pt}}%
219 \pgfusepath{fill}%
220 \pgfsetfillcolor{blue!85}%
221 \pgfpathrectangle{\pgfpoint{0pt}{2pt}}{\pgfpoint{100pt}{2.5pt}}%
222 \pgfusepath{fill}%
223 }%
224
225
226 \pgfdeclarepatterninherentlycolored{crosshatch dots gray}
227 {\pgfpointorigin}{\pgfpoint{8pt}{8pt}}
228 {\pgfpoint{8pt}{8pt}}
229 {%
230 \pgfsetfillcolor{black!20}%
231 \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{8pt}{8pt}}%
232 \pgfusepath{fill}%
233 \pgfsetfillcolor{black!10}%
234 \pgfpathcircle{\pgfpoint{2pt}{1.75pt}}{1pt}%
235 \pgfpathcircle{\pgfpoint{6pt}{5.75pt}}{1pt}%
236 \pgfusepath{fill}%
237 \pgfsetfillcolor{black!70}%
238 \pgfpathcircle{\pgfpoint{2pt}{2.25pt}}{1pt}%
239 \pgfpathcircle{\pgfpoint{6pt}{6.25pt}}{1pt}%
240 \pgfusepath{fill}%
241 }%
242
243 \pgfutil@definecolor{pgf@lightsteelblue}{rgb}{0.6875,0.765625,0.8671875}%
244 \pgfutil@colorlet{pgf@darklightsteelblue}{black!50!pgf@lightsteelblue}%
245
246 \pgfdeclarepatterninherentlycolored{crosshatch dots light steel blue}
247 {\pgfpointorigin}{\pgfpoint{8pt}{8pt}}
248 {\pgfpoint{8pt}{8pt}}
249 {%
250 \pgfsetfillcolor{pgf@lightsteelblue}%
251 \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{8pt}{8pt}}%
252 \pgfusepath{fill}%
253 \pgfsetfillcolor{pgf@darklightsteelblue!10}%
254 \pgfpathcircle{\pgfpoint{2pt}{1.75pt}}{1pt}%
255 \pgfpathcircle{\pgfpoint{6pt}{5.75pt}}{1pt}%
256 \pgfusepath{fill}%
257 \pgfsetfillcolor{pgf@darklightsteelblue!70}%
258 \pgfpathcircle{\pgfpoint{2pt}{2.25pt}}{1pt}%
259 \pgfpathcircle{\pgfpoint{6pt}{6.25pt}}{1pt}%
260 \pgfusepath{fill}%
261 }%
262
263
264 \endinput