summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/tikzpingus/tikzpingus-christmas.lib.tex
blob: b0a598a5e0000bfbabb305c192be696ba27b3dea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
% Florian Sihler, 2022
% Licensed under GNU General Public License version 3
% https://opensource.org/licenses/gpl-3.0.html
\pingu@create@extra{santahat}{%
    santa hat/.code             = \pingu@set@extra{santahat}{true}\pingu@color{santahat}{#1}\pgfqkeys{/pingu}{hair=\@pingu@none},
    santa hat/.default          = pingu@red!87!pingu@black,
    santa hat second/.code      = \pingu@color{santahat@second}{#1},
    santa hat bobble/.code      = \pingu@color{santahat@bobble}{#1}
}{santa hat second={pingu@white!97!\pingu@color@santahat},santa hat bobble={\pingu@color@santahat@second}}
\def\pingu@draw@ea@santahat{%
\path (\pingu@name-head-center)+(152:\pingu@w@half{} and \pingu@head@h@half) coordinate (\pingu@name-santa-right);
\path (\pingu@name-head-center)+(5:\pingu@w@half{} and \pingu@head@h@half) coordinate (\pingu@name-santa-left);
\pingu@layer{middle}[]
\pingu@block{\pingu@color@santahat@second} (\pingu@name-santa-right) to[out=48,in=132] (\pingu@name-santa-left) to[out=30,in=-45,looseness=1.325] ++(0,3.2mm)
to[out=135,in=47,looseness=1.025] coordinate[pos=.915] (\pingu@name-santa-ur) coordinate[pos=.055] (\pingu@name-santa-ul) ([yshift=2mm]\pingu@name-santa-right) to[out=240,in=140] cycle;
\endpingu@layer
\pingu@layer{background}[]
\pingu@block{\pingu@color@santahat} (\pingu@name-santa-ur) arc(145:-25:11.85mm and 14.915mm)
    to[bend right=7] coordinate[pos=.5] (\pingu@name-santa-lc) ++(-1.11mm,.375mm) to[bend right=11] (\pingu@name-santa-ul) to[bend right=15] cycle;
\pingu@block{\pingu@color@santahat@bobble} (\pingu@name-santa-lc) circle[radius=2.625mm];
\endpingu@layer
}
\pingu@create@extra{santabeard}{%
    santa beard/.code             = \pingu@set@extra{santabeard}{true}\pingu@color{santabeard}{#1},
    santa beard/.default          = pingu@white!96!pingu@red!98!pingu@black!92!gray,
    santa beard string/.code      = \pingu@color{santabeard@string}{#1}
}{santa beard string=\pingu@color@body@main!85!pingu@black}
\def\pingu@draw@ea@santabeard{%
% \coordinate (\pingu@name-santa-beard-center) at ([yshift=1.25mm]\pingu@name-belly-center);
\pingu@block{\pingu@color@santabeard@string} ([xshift=-.35mm,yshift=.575mm]\pingu@name-head-back-con-right) to[bend right=28,edge node={foreach[count=\i] \l in {0.03,0.085,...,0.992} {coordinate[pos=\l-rand*.015,yshift=-.85pt] (\pingu@name-santa-beard-\i)}}]
([yshift=.575mm,xshift=.35mm]\pingu@name-head-back-con-left) arc(20:110:.05mm and .15mm) to[bend left=26] ([yshift=.575mm+.15mm,xshift=-.35mm]\pingu@name-head-back-con-right) to[bend right] cycle;
\ifx\pingu@color@santabeard\@pingu@none\else% to allow for random
\xdef\@pmaxY{18}\xdef\@pmaxYI{17}%
\foreach[evaluate=\j as \maxj using int(\@pmaxY-\j),evaluate=\j as \widthred using \j/23pt] \j in {0,...,\@pmaxYI} {
\foreach[remember=\i as \li (initially 0)] \i in {1,...,\maxj} {
    \pgfmathsetmacro\@ptmp{94+rand*2.6}
    \pingu@block{\pingu@color@santabeard!\@ptmp!pingu@black} (\pingu@name-santa-beard-\i) circle [radius=1.85pt-\widthred pt+rand*.35pt];
    \ifnum\li>0 % make middle of last
        \path (\pingu@name-santa-beard-\li) -- (\pingu@name-santa-beard-\i) coordinate[pos=.5,yshift=-1.1pt,xshift=.133pt] (\pingu@name-santa-beard-\li); % smoll shift
    \fi
}}\fi
}