Debian Codegraph @

texmf-dist/tex/latex/tikzpeople/tikzpeople.shape.cowboy.sty

raw
1 %% Copyright 2016 Nils Fleischhacker
2 %%
3 %% This work may be distributed and/or modified under the
4 %% conditions of the LaTeX Project Public License, either
5 %% version 1.3 of this license or (at your option) any later
6 %% version. The latest version of this license is in
7 %%
8 %% http://www.latex-project.org/lppl.txt
9 %%
10 %% and version 1.3 or later is part of all distributions of
11 %% LaTeX version 2005/12/01 or later.
12 %%
13 %% This work has the LPPL maintenance status `maintained'.
14 %%
15 %% The Current Maintainer of this work is Nils Fleischhacker.
16 \tikzpeople@addcolorkey{vest}
17 \tikzpeople@addcolorkey{patches}
18 \tikzpeople@addcolorkey{stitching}
19 \tikzpeople@addcolorkey{tie}
20
21 \newcommand{\tikzpeople@cowboy@paint}{
22 \tikzpeople@person@paintshirt
23 \tikzpeople@cowboy@paintshirtdetails
24 {
25 \pgftransformshift{\pgfpoint{0}{.8pt}}
26 \tikzpeople@person@paintrighthorn
27 }
28 \tikzpeople@person@painthead
29 \tikzpeople@person@painthair
30 \tikzpeople@cowboy@painthat
31 {
32 \pgftransformshift{\pgfpoint{0}{1.2pt}}
33 \tikzpeople@person@paintlefthorn
34 }
35 \tikzpeople@person@paintgoatee
36 \tikzpeople@person@painthalo
37 }
38
39 \newcommand{\tikzpeople@cowboy@paintshirtdetails}{
40 \begin{scope}
41 \clip
42 (-4pt,-8pt) .. controls (-2pt,-10pt) and (3pt,-9pt) ..
43 ( 5pt,-7pt) .. controls ( 5pt, 0pt) and (-5pt,0pt) ..
44 (-4pt,-8pt);
45 \draw[vest,postaction={
46 decoration={
47 markings,
48 mark=at position 0.16 with {\coordinate (tikzpeople@tmp1) at (-.1pt*\scalingfactor,-.1pt*\scalingfactor);},
49 mark=at position 0.28 with {\coordinate (tikzpeople@tmp2) at (-.1pt*\scalingfactor,-.1pt*\scalingfactor);},
50 mark=at position 0.6 with {\coordinate (tikzpeople@tmp3) at (-.1pt*\scalingfactor,-.1pt*\scalingfactor);},
51 mark=at position 0.72 with {\coordinate (tikzpeople@tmp4) at (-.1pt*\scalingfactor,-.1pt*\scalingfactor);};
52 },decorate
53 }]
54 (232:3pt) to[out=315,in=90] ++(2.5pt,-5.5pt) --
55 ++(-2.5pt,0) to[out=90,in=315] ++(-2pt,4pt)--cycle;
56 \draw[patches,postaction={
57 decoration={
58 markings,
59 mark=between positions 0.22 and 0.48 step 0.045 with {\draw[stitching] (.2pt*\scalingfactor,-.1pt*\scalingfactor) -- (0,.1pt*\scalingfactor);},
60 mark=between positions 0.73 and 1 step 0.045 with {\draw[stitching] (.2pt*\scalingfactor,-.1pt*\scalingfactor) -- (0,.1pt*\scalingfactor);}
61 },decorate
62 }]
63 (tikzpeople@tmp1) to[out=300,in=105] (tikzpeople@tmp2) to[out=190,in=45] (tikzpeople@tmp3) to[out=100,in=300]
64 (tikzpeople@tmp4) to[out=40,in=190] (tikzpeople@tmp1);
65 \draw[vest,postaction={
66 decoration={
67 markings,
68 mark=at position 0.14 with {\coordinate (tikzpeople@tmp1) at (.1pt*\scalingfactor,.1pt*\scalingfactor);},
69 mark=at position 0.25 with {\coordinate (tikzpeople@tmp2) at (.1pt*\scalingfactor,.1pt*\scalingfactor);},
70 mark=at position 0.615 with {\coordinate (tikzpeople@tmp3) at (.1pt*\scalingfactor,.1pt*\scalingfactor);},
71 mark=at position 0.715 with {\coordinate (tikzpeople@tmp4) at (.1pt*\scalingfactor,.1pt*\scalingfactor);};
72 },decorate
73 }]
74 (314:3pt) to[out=245,in=100] ++(-.5pt,-5.5pt) --
75 ++(1.8pt,.8pt) to[out=95,in=250] ++(.5pt,4.5pt)--cycle;
76 \draw[patches,postaction={
77 decoration={
78 markings,
79 mark=between positions 0.28 and 0.52 step 0.055 with {\draw[stitching] (-.2pt*\scalingfactor,-.1pt*\scalingfactor) -- (0,.1pt*\scalingfactor);},
80 mark=between positions 0.76 and 1 step 0.055 with {\draw[stitching] (-.2pt*\scalingfactor,-.1pt*\scalingfactor) -- (0,.1pt*\scalingfactor);}
81 },decorate
82 }]
83 (tikzpeople@tmp1) to[out=255,in=92] (tikzpeople@tmp2) to[out=357,in=178] (tikzpeople@tmp3) to[out=98,in=268]
84 (tikzpeople@tmp4) to[out=170,in=0] (tikzpeople@tmp1);
85 \draw[tie,shading angle=-45]
86 (.2pt,-3.7pt) to[out=280,in=80] ++(-.2pt,-1.5pt) .. controls +(-.2pt,1pt)
87 and +(-1.3pt,-.1pt) .. (.2pt,-3.7pt);
88 \draw[tie]
89 (234:3pt) to[out=316,in=120] (.4pt,-4.4pt) to[out=40,in=250] (312:3pt);
90 \draw[tie,shading angle=-45]
91 (1pt,-3.8pt) to[out=300,in=80] ++(.5pt,-1pt) to[out=260,in=85]
92 ++(-.3pt,-1.4pt) arc (85:92:.3pt) to[out=92,in=268]
93 ++(-1.2pt,2.2pt) to[out=88,in=135] (1pt,-3.8pt) -- cycle;
94 \end{scope}
95 }
96
97 \newcommand{\tikzpeople@cowboy@painthat}{
98 \pgftransformrotate{5}
99 \path[hat]
100 (15:3pt) ++(-.7pt,3pt) coordinate (tikzpeople@tmp) (165:3pt) --
101 ++(.7pt,3pt) to[out=10,in=170] (tikzpeople@tmp) -- (15:3pt) --cycle;
102 \begin{scope}
103 \pgftransformshift{\pgfpoint{0}{.2pt}}
104 \path[hatrim]
105 (203:3pt) ++(-2.5pt,3.3pt) coordinate (tikzpeople@tmp) arc (250:282:19pt) arc
106 (102:-78:.3pt) arc (282:248.5:19pt) to[out=150, in= 160] (tikzpeople@tmp);
107 \end{scope}
108 \path[hat]
109 (357:3pt) to[out=160,in=20] (183:3pt) arc (183:203:3pt) to[out=180,in=175]
110 ++(-2.5pt,3.3pt) arc (250:282:19pt) to[out=10,in=10] (335:3pt) arc
111 (335:357:3pt) --cycle;
112 }
113
114 \newcommand{\tikzpeople@cowboy@definecolors}{
115 \definecolor{shirt}{RGB}{56,52,182}
116 \definecolor{hat}{RGB}{105,49,0}
117 \definecolor{hair}{RGB}{28,26,25}
118 \definecolor{vest}{RGB}{204,100,0}
119 \definecolor{patches}{RGB}{254,145,42}
120 \definecolor{stitching}{RGB}{184,90,0}
121 \definecolor{tie}{RGB}{205,0,20}
122 }
123 \newcommand{\tikzpeople@cowboy@definestyles}{
124 \if@tikzpeople@saturated
125 \tikzset{
126 hatrim/.style={color=\tikzpeople@hat!70,top color=\tikzpeople@hat!20, bottom color=\tikzpeople@hat!70,shading angle=90},
127 vest/.style={color=\tikzpeople@vest,top color=\tikzpeople@vest!70,bottom color=\tikzpeople@vest,shading angle=45},
128 patches/.style={color=\tikzpeople@patches,top color=\tikzpeople@patches!70,bottom color=\tikzpeople@patches,shading angle=45},
129 stitching/.style={line cap=round,line width=.09pt*\scalingfactor,color=\tikzpeople@stitching},
130 tie/.style={color=\tikzpeople@tie,top color=\tikzpeople@tie!70, bottom color=\tikzpeople@tie,shading angle=45}
131 }
132 \else
133 \tikzset{
134 hatrim/.style={color=\tikzpeople@hat!40,top color=\tikzpeople@hat!10, bottom color=\tikzpeople@hat!40,shading angle=90},
135 vest/.style={color=\tikzpeople@vest!80,top color=\tikzpeople@vest!40, bottom color=\tikzpeople@vest!80,shading angle=45},
136 patches/.style={color=\tikzpeople@patches!80,top color=\tikzpeople@patches!40, bottom color=\tikzpeople@patches!80,shading angle=45},
137 stitching/.style={line cap=round,line width=.09pt*\scalingfactor,color=\tikzpeople@stitching},
138 tie/.style={color=\tikzpeople@tie!80,top color=\tikzpeople@tie!50, bottom color=\tikzpeople@tie!80,shading angle=45}
139 }
140 \fi
141 }
142
143 \newcommand{\tikzpeople@cowboy@colors}{
144 shirt/350/{1/-.5}, hair/180/{-.7/.7}, hat/160/{-1/1}, tie/10/{.1/-.25},
145 skin/30/{.5/.8}, vest/195/{-.7/-.3}, patches/210/{-.5/-.7},
146 stitching/330/{-.18/-.85,.53/-.71}%
147 }