% Florian Sihler, 2022
% Licensed under GNU General Public License version 3
% https://opensource.org/licenses/gpl-3.0.html
\pingu@create@extra{cakehat}{%
  cake-hat/.code          = \pingu@set@extra{cakehat}{true}\pingu@color{cakehat}{#1},
  cake-hat/.default       = pingu@white!92!\pingu@color@cakehat@top,
  cake-hat top/.code      = \pingu@color{cakehat@top}{#1},
  cake-hat shade/.code    = \pingu@color{cakehat@shade}{#1},
  cake-hat candle/.code   = \pingu@color{cakehat@candle}{#1},
  cake-hat candle fire/.code   = \pingu@color{cakehat@candle@fire}{#1},
  cake-hat candle fire 2/.code   = \pingu@color{cakehat@candle@fire@b}{#1},
  cake-hat candle fire 3/.code   = \pingu@color{cakehat@candle@fire@c}{#1},
  cake-hat candle wick/.code   = \pingu@color{cakehat@candle@wick}{#1},
  cake-hat candle shade/.code   = \pingu@color{cakehat@candle@shade}{#1},
  cake-hat candle back/.code = \pingu@color{cakehat@candle@back}{#1},
  cake-hat outline/.code  = \pingu@color{cakehat@outline}{#1},
  cake-hat outline width/.code  = \def\pingu@x@cakehat@outline@w{#1},
  cake-hat position/.code args  = {#1:(#2,#3)#4}{\def\pingu@x@cakehat@angle{#1}\def\pingu@x@cakehat@xshift{#2}\def\pingu@x@cakehat@yshift{#3}\def\pingu@x@cakehat@scale{#4}}
}{cake-hat position={-9:(1mm,0mm)1},cake-hat outline=pingu@black!80!\pingu@color@cakehat,cake-hat outline width=.25pt,cake-hat top=pingu@purple,cake-hat candle=pingu@purple!60!pingu@black,cake-hat candle back=\pingu@color@cakehat@candle!85!black,cake-hat candle wick=pingu@black,cake-hat candle fire=pingu@red,cake-hat candle fire 2=\pingu@color@cakehat@candle@fire!50!yellow,cake-hat candle fire 3=\pingu@color@cakehat@candle@fire@b!50!white,cake-hat shade=gray,cake-hat candle shade=gray!80!\pingu@color@cakehat@candle@back}

\def\pingu@p@cake@outline{(-6.25mm,-.25cm) to[bend left=2] (\pingu@name-cake-tl) arc (180:0:1.375cm/2+.01mm and 1.41mm) to[bend left=2] ++(0,-3.125mm*.97) to[bend left=20] (-6mm,-.26cm) -- cycle}
\def\pingu@draw@ea@cakehat{%
\scope[rotate around={\pingu@x@cakehat@angle:(\pingu@name-head-top)},%
shift={(\pingu@name-head-top)},
shift={(\pingu@x@cakehat@xshift,\pingu@x@cakehat@yshift)},
scale=\pingu@x@cakehat@scale]
  \pingu@block{\pingu@color@cakehat} [rounded corners=.2mm](-6.25mm,-.25cm) to[bend left=2] coordinate[pos=.97] (\pingu@name-cake-tl) ++(0,3.125mm) to[bend right=20]
    ++(1.375cm,0) to[bend left=2] coordinate[pos=.03] (\pingu@name-cake-tr) ++(0,-3.125mm) to[bend left=20] (-6mm,-.26cm) -- cycle;
  \pingu@block[fill opacity=.1]{\pingu@color@cakehat@shade} [rounded corners=.2mm](-6.25mm,-.25cm) to[bend right=20]
    ++(1.375cm,0) to[bend right=2] ++(0,3.125mm) [sharp corners] to[bend left=20] (-6.25mm,-.225cm) [rounded corners=.2mm] -- cycle;
  \path (\pingu@name-cake-tl) -- (\pingu@name-cake-tr) coordinate[pos=.5] (\pingu@name-cake-tc);
  % cake side
  \scope
  \clip\pingu@p@cake@outline;
  \path (\pingu@name-cake-tl) arc (180:360:1.375cm/2+.01mm and 1.41mm) foreach[count=\i] \a in {0,.19,.295,.375,.485,.625,.72,.85,1} {coordinate[pos=\a] (\pingu@name-cake-\i)};
  \pingu@block{\pingu@color@cakehat@top} (\pingu@name-cake-1) ellipse [x radius=.255mm,y radius=2mm];
  \pingu@block{\pingu@color@cakehat@top} (\pingu@name-cake-9) ellipse [x radius=.265mm,y radius=1.45mm];
  \foreach \i in {2,...,9} {
    \pgfmathsetmacro\@tmprand{rand}
    \pingu@draw[opacity=.5]{gray} (\pingu@name-cake-\i)++(-.02mm,0) to[bend left=1] ++(+.145mm,{-1.075mm-(\@tmprand+.15)*.5125mm}) arc(370:300:.145mm);
    \pingu@block{\pingu@color@cakehat@top} (\pingu@name-cake-\i)++(0,.1mm) -- ++(-.125mm,0) to[bend left=1] ++(0,{-1.2mm-(\@tmprand+.15)*.5125mm}) arc(170:370:.145mm) to[bend right=1] cycle;
  }
  \foreach \i in {2,...,9} {
      \ifnum\i=2\relax
        \pingu@block{\pingu@color@cakehat@top} (\pingu@name-cake-\the\numexpr\i-1\relax)++(-.05mm,-.5mm) to[bend left=8] ([xshift=-.05mm,yshift=-.25mm]\pingu@name-cake-\i) -- ++(0,.33mm) to[bend right=30] (\pingu@name-cake-\the\numexpr\i-1\relax);
      \else\ifnum\i=9\relax
        \pingu@block{\pingu@color@cakehat@top} (\pingu@name-cake-\the\numexpr\i-1\relax)++(-.05mm,-.25mm) to[bend left=8] ([xshift=-.05mm,yshift=-.5mm]\pingu@name-cake-\i) -- ++(0,.33mm) to[bend right=30] (\pingu@name-cake-\the\numexpr\i-1\relax);
      \else
      \pingu@block{\pingu@color@cakehat@top} (\pingu@name-cake-\the\numexpr\i-1\relax)++(-.05mm,-.25mm) to[bend left=9.5+2*rand] ([xshift=-.05mm,yshift=-.25mm]\pingu@name-cake-\i) -- ++(0,.33mm) to[bend right=30] (\pingu@name-cake-\the\numexpr\i-1\relax);
      \fi\fi
  }
  \endscope
  \pingu@block{\pingu@color@cakehat@top} (\pingu@name-cake-tc) ellipse [x radius=1.375cm/2+.01mm, y radius=1.41mm];
  % outline
  \pingu@draw[line width=\pingu@x@cakehat@outline@w,rounded corners=.075mm]{\pingu@color@cakehat@outline} \pingu@p@cake@outline;
% % 3d sides
%   \pingu@block[rounded corners=.04mm]{\pingu@color@cakehat@top} ([xshift=.1mm,yshift=.125mm]\pingu@name-cake-tl) to[out=246,in=97] ++(-.11mm,-2.125mm) -- ++(.04mm,0) to[bend right=12] (\pingu@name-cake-ttl) -- cycle;
%   \pingu@block[rounded corners=.09mm]{green} ([xshift=-.1mm]\pingu@name-cake-ttr) to[out=294,in=83] ++(.125mm,-2.125mm) to[bend left=12] ([xshift=-.11mm,yshift=.125mm]\pingu@name-cake-tr) -- cycle;
  % candle
  \pingu@block{\pingu@color@cakehat@candle@back} (\pingu@name-cake-tc)++(.8mm,2.66mm) to[bend right=7] ++(-1.1mm,-.1mm) to[bend right=30]++(1.1mm,0) -- cycle;
  % wick
  \pingu@draw[very thin]{\pingu@color@cakehat@candle@wick} (\pingu@name-cake-tc)++(.25mm,2mm) to[out=75,in=-95] coordinate[pos=.8] (\pingu@name-wick-1) ++(0,1mm) coordinate(\pingu@name-wick-top);
  \pingu@block{\pingu@color@cakehat@candle@fire} (\pingu@name-wick-1)++(-.045mm,0) to[out=115,in=240] ++(0,1.5mm) to[out=300,in=65] ([xshift=.045mm]\pingu@name-wick-1) -- cycle;
  \pingu@block{\pingu@color@cakehat@candle@fire@b} (\pingu@name-wick-1)++(-.045mm,0) to[out=105,in=240] ++(0,1.3mm) to[out=300,in=75] ([xshift=.045mm]\pingu@name-wick-1) -- cycle;
  \pingu@block{\pingu@color@cakehat@candle@fire@c} (\pingu@name-wick-1)++(-.035mm,0) to[out=95,in=250] ++(0,1.1mm) to[out=290,in=85] ([xshift=.035mm]\pingu@name-wick-1) -- cycle;
  % front
  \pingu@block{\pingu@color@cakehat@candle} (\pingu@name-cake-tc)++(.25mm,0) ++(.55mm,0) to[bend left=0.5] ++(0,2.66mm) to[bend left=20] ++(-1.1mm,-.1mm) to[bend right=0.5] ++(0,-2.66mm) to[bend right=20] cycle;
  \pingu@block[fill opacity=.125]{\pingu@color@cakehat@candle@shade} (\pingu@name-cake-tc)++(-.3mm,-.1mm) to[bend right=20] ++(1.1mm,0) to[bend left=.5] ++(0,2.66mm) to[bend left=15] ++(-1.1mm,-2.5mm) -- cycle;
  \pingu@block[fill opacity=.225]{\pingu@color@cakehat@candle@shade} (\pingu@name-cake-tc)++(-.3mm,-.1mm) to[bend left=2] ++(1.1mm,-1.1mm) to[bend left=5] ++(1.1mm,0) to[bend left=2] ++(-1.1mm,1.2mm) to[bend left =15] cycle;
  \pingu@block[fill opacity=.225]{\pingu@color@cakehat@candle@shade} (\pingu@name-cake-tc)++(1.35mm,-1.25mm) circle [radius=.1mm];
\endscope
}
\pingu@create@extra{pumpkinhat}{%
  pumpkin-hat/.code           = \pingu@set@extra{pumpkinhat}{true}\pingu@color{pumpkinhat}{#1},
  pumpkin-hat/.default        = pingu@bronze!97!white,
  pumpkin-hat stalk/.code     = \pingu@color{pumpkinhat@stalk}{#1},
  pumpkin-hat stalk top/.code = \pingu@color{pumpkinhat@stalk@top}{#1},
  pumpkin-hat stripe a/.code  = \pingu@color{pumpkinhat@stripe@a}{#1},
  pumpkin-hat stripe b/.code  = \pingu@color{pumpkinhat@stripe@b}{#1},
  pumpkin-hat stripe c/.code  = \pingu@color{pumpkinhat@stripe@c}{#1},
  pumpkin-hat outline/.code   = \pingu@color{pumpkinhat@outline}{#1},
  pumpkin-hat outline width/.code = \def\pingu@x@pumpkinhat@outline@w{#1},
  pumpkin-hat position/.code args  = {#1:(#2,#3)#4}{\def\pingu@x@pumpkinhat@angle{#1}\def\pingu@x@pumpkinhat@xshift{#2}\def\pingu@x@pumpkinhat@yshift{#3}\def\pingu@x@pumpkinhat@scale{#4}}
}{pumpkin-hat position={-9:(1.65mm,.25mm)1.05},pumpkin-hat stalk=pingu@green!95!\pingu@color@pumpkinhat!45!pingu@black,pumpkin-hat stalk top=\pingu@color@pumpkinhat@stalk!95!pingu@black,pumpkin-hat stripe a=pingu@black,pumpkin-hat stripe b=\pingu@color@pumpkinhat@stripe@a,pumpkin-hat stripe c=\pingu@color@pumpkinhat@stripe@b,pumpkin-hat outline=pingu@black,pumpkin-hat outline width=.7pt}

\def\pingu@pumpkinhat@outerpath{(0,.125cm)++(-60:6.75mm and 5.5mm) arc(-60:86: 6.75mm and 5.5mm) to[bend left=3] ++(-1.75mm,0) arc(95:242:6.75mm and 5.5mm) to[bend left=5] cycle;}
\def\pingu@draw@ea@pumpkinhat{%
\scope[rotate around={\pingu@x@pumpkinhat@angle:(\pingu@name-head-top)},%
shift={(\pingu@name-head-top)},
shift={(\pingu@x@pumpkinhat@xshift,\pingu@x@pumpkinhat@yshift)},
scale=\pingu@x@pumpkinhat@scale]
  % give it a small cut
  \pingu@block{\pingu@color@pumpkinhat} (0,.125cm)++(-60:6.75mm and 5.5mm) coordinate (@pkll) arc(-60:86: 6.75mm and 5.5mm) coordinate (@pkl) to[bend left=3] coordinate[pos=.5] (@pkuc) ++(-1.75mm,0) coordinate (@pkr) arc(95:242:6.75mm and 5.5mm) coordinate (@pklr) to[bend left=5] coordinate[pos=.5] (@pklc) cycle;
  \pingu@draw[line join=round,line width=\pingu@x@pumpkinhat@outline@w]{\pingu@color@pumpkinhat@outline} \pingu@pumpkinhat@outerpath;
\scope
\clip (0,.125cm)++(-60:6.75mm and 5.5mm) coordinate (@pkll) arc(-60:86: 6.75mm and 5.5mm) coordinate (@pkl) to[bend left=3] ++(-1.75mm,0) coordinate (@pkr) arc(95:242:6.75mm and 5.5mm) coordinate (@pklr) to[bend left=5] cycle;
  \pingu@draw[line cap=round,opacity=.3]{\pingu@color@pumpkinhat@stripe@a} (@pklr) to[bend left=55] (@pkr);
  \pingu@draw[line cap=round,opacity=.3]{\pingu@color@pumpkinhat@stripe@c} (@pkll) to[bend right=55] (@pkl);
  \pingu@draw[line cap=round,opacity=.3]{\pingu@color@pumpkinhat@stripe@b} (@pklc) to[bend right=5] (@pkuc);
\endscope
\pingu@block{\pingu@color@pumpkinhat@stalk} ([yshift=-.5*\pingu@x@pumpkinhat@outline@w]@pkl) to[bend left=3] ([yshift=-.5*\pingu@x@pumpkinhat@outline@w]@pkr) to[bend right=8] ++(.85mm,2mm) -- ++(.65mm,0) coordinate[pos=.5] (@pkc) to[bend right=3] cycle;
\pingu@block{\pingu@color@pumpkinhat@stalk@top} (@pkc) ellipse[x radius=.65mm/2, y radius=.085mm];
\endscope
}

\pingu@create@wing@extra{lollipop}{%
  lollipop \@lr/.code         = {\pingu@set@extra{lollipop\@lr}{true}\pingu@color{lollipop\@lr}{##1}},
  lollipop \@lr/.default      = pingu@green,
  lollipop \@lr\space handle/.code = \pingu@color{lollipop\@lr @handle}{##1},%
  lollipop \@lr\space second/.code = \pingu@color{lollipop\@lr @second}{##1}%
}{lollipop \@lr\space handle=pingu@bronze,lollipop \@lr\space second={\csname pingu@color@lollipop\@lr\endcsname!86!white}}

% #1 wing
\def\pingu@draw@wi@lollipop#1{%
    \pingu@setup@wing{lollipop}{#1}%
    \pingu@draw[thick,rotate around={\@angle:(\pingu@name-wing-#1)}]{\csname pingu@color@lollipop#1@handle\endcsname}(\pingu@name-wing-#1)++(0,4.75mm) -- ++(0,-6.25mm);
    \pingu@block[thick,rotate around={\@angle:(\pingu@name-wing-#1)}]{\@col}(\pingu@name-wing-#1)++(0,4.75mm) coordinate (\pingu@name-lollipop-#1-top) circle[radius=1.4mm];
    \pingu@block[thick,rotate around={\@angle-1:(\pingu@name-lollipop-#1-top)}]{\csname pingu@color@lollipop#1@second\endcsname} (\pingu@name-lollipop-#1-top) ellipse [x radius=1.57mm, y radius=1.5\p@];
    \pingu@block[thick,rotate around={\@angle-1:(\pingu@name-lollipop-#1-top)}]{\@col} (\pingu@name-lollipop-#1-top)++(0,.5\p@) ellipse [x radius=1.4mm, y radius=\p@];
}

\pingu@create@extra{heart}{%
  heart/.code       = {\pingu@set@extra{heart}{true}\pingu@color{heart}{#1}},
  heart/.default    = lightgray
}{}

\def\pingu@draw@eb@heart{%
    \pingu@block[sharp corners]{\pingu@color@heart}
    ([yshift=1mm]\pingu@name-belly-center) arc(0:180:.13cm)
    to[out=270,in=110] ++(.26cm,-.36cm) to[out=70,in=270] ++(.26cm,.36cm) arc (0:180:.13cm) -- cycle;
}

\pingu@create@extra{vampireteeth}{%
  vampire teeth/.code       = {\pingu@set@extra{vampireteeth}{true}\pingu@color{vampireteeth}{#1}},
  vampire teeth/.default    = pingu@yellow!10!pingu@black!70!lightgray
}{}

\def\pingu@draw@eb@vampireteeth{%
    \pingu@block{\pingu@color@vampireteeth} (\pingu@name-bill) ++(-1.35mm,-2.5mm)
    arc(180:0:1.35mm and 2.5mm)
    arc(0:180:1.35mm and .95mm);
}

\pingu@create@wing@extra{broom}{%
    broom \@lr/.code                    = {\pingu@set@extra{broom\@lr}{true}\pingu@color{broom\@lr}{##1}},
    broom \@lr/.default                 = pingu@bronze,
    broom \@lr\space length/.code       = \expandafter\def\csname pingu@broom@\@lr @length\endcsname{##1},
    broom \@lr\space shift/.code        = \expandafter\def\csname pingu@broom@\@lr @shift\endcsname{##1},
    broom \@lr\space band/.code          = \pingu@color{broom@\@lr @band}{##1},
    broom \@lr\space bristles a/.code   = \pingu@color{broom@\@lr @bristles@a}{##1},
    broom \@lr\space bristles b/.code   = \pingu@color{broom@\@lr @bristles@b}{##1},
    broom \@lr\space bristles c/.code   = \pingu@color{broom@\@lr @bristles@c}{##1},
}{broom \@lr\space length=22mm,broom \@lr\space shift=8mm, broom \@lr\space band=pingu@red!80!pingu@black!80!pingu@bronze, broom \@lr\space bristles a=pingu@bronze!16!pingu@yellow!41!pingu@white!80!brown!95!\csname pingu@color@broom\@lr\endcsname, broom \@lr\space bristles b=\csname pingu@color@broom@\@lr @bristles@a\endcsname!83!pingu@white, broom \@lr\space bristles c=\csname pingu@color@broom@\@lr @bristles@b\endcsname!83!pingu@white}
\def\pingu@draw@wi@broom#1{%
    \pingu@setup@wing{broom}{#1}%
    % TODO: mirror on other wing?
\scope[rotate around={\@angle:(\pingu@name-wing-#1)}]
    \pingu@block{\csname pingu@color@broom#1\endcsname}(\pingu@name-wing-#1)++(\@sidesign*-.2mm,-\csname pingu@broom@#1@shift\endcsname) -- ++(0,\csname pingu@broom@#1@length\endcsname) arc(180:0:\@sidesign*.4mm and .3mm) coordinate[pos=.5] (\pingu@name-broom-#1-top) -- ++(0,-\csname pingu@broom@#1@length\endcsname) arc(360:180:\@sidesign*.4mm and .3mm) -- cycle;
    \pingu@block[rounded corners=.44pt]{\csname pingu@color@broom@#1@bristles@a\endcsname} (\pingu@name-broom-#1-top)++(-1mm,-2mm) to[out=115,in=240] ++(1mm,10.5mm) to[out=300,in=65] ([xshift=.95mm,yshift=-2mm]\pingu@name-broom-#1-top) to[bend right=4] ([xshift=-.75mm,yshift=-2mm]\pingu@name-broom-#1-top) -- cycle;
    \pingu@block[rounded corners=.44pt]{\csname pingu@color@broom@#1@bristles@a\endcsname} (\pingu@name-broom-#1-top)++(-1mm,-2mm) to[out=115,in=240] ++(1.66mm,9.75mm) to[out=300,in=65] coordinate[pos=.81] (@l) coordinate[pos=.79] (@l2) ([xshift=.95mm,yshift=-2mm]\pingu@name-broom-#1-top) to[bend right=4] ([xshift=-.75mm,yshift=-2mm]\pingu@name-broom-#1-top) -- cycle;
    \pingu@block[rounded corners=.44pt]{\csname pingu@color@broom@#1@bristles@a\endcsname} (\pingu@name-broom-#1-top)++(-1mm,-2mm) to[out=115,in=240] coordinate[pos=.17] (@r) coordinate[pos=.19] (@r2)  ++(.25mm,10.5mm) to[out=300,in=65] ([xshift=.95mm,yshift=-2mm]\pingu@name-broom-#1-top) to[bend right=4] ([xshift=-.75mm,yshift=-2mm]\pingu@name-broom-#1-top) -- cycle;
    \pingu@block[rounded corners=.44pt]{\csname pingu@color@broom@#1@bristles@b\endcsname} (\pingu@name-broom-#1-top)++(-.75mm,-1.75mm) to[out=115,in=240] ++(1.35mm,9.25mm) to[out=300,in=65] ([xshift=.75mm,yshift=-1.75mm]\pingu@name-broom-#1-top) -- cycle;
    \pingu@block[rounded corners=.44pt]{\csname pingu@color@broom@#1@bristles@b\endcsname} (\pingu@name-broom-#1-top)++(-.75mm,-1.75mm) to[out=115,in=240] ++(0mm,9.65mm) to[out=300,in=65] ([xshift=.75mm,yshift=-1.75mm]\pingu@name-broom-#1-top) -- cycle;
    \pingu@block{\csname pingu@color@broom@#1@bristles@c\endcsname} (\pingu@name-broom-#1-top)++(-.5mm,-1.5mm) to[out=115,in=240] ++(.5mm,9.5mm) to[out=300,in=65] ([xshift=.5mm,yshift=-1.5mm]\pingu@name-broom-#1-top) -- cycle;
    % TODO: broom cap color etc
    \pingu@block{\csname pingu@color@broom@#1@band\endcsname} (@r) to[bend right=10] (@l) -- (@l2) to[bend left=10] (@r2);
\endscope
}

\tikzset{pingu@clip even odd rule/.code={\pgfseteorule}, % Credit to Andrew Stacey
pingu@invclip/.style={
    clip,insert path=
        [pingu@clip even odd rule]{
            [reset cm](-\maxdimen,-\maxdimen)rectangle(\maxdimen,\maxdimen)
        }
}}
\pingu@create@extra{jackolantern}{%
  jack o lantern/.code           = \pingu@set@extra{jackolantern}{true}\pingu@color{jackolantern}{#1},
  jack o lantern/.default        = pingu@bronze!97!pingu@black,
  jack o lantern helmet/.style   = {jack o lantern=#1,jack o lantern background=none,jack o lantern position={-2.15:(2.05mm,-11.35mm){1.5}},jack o lantern back stripe a=\@pingu@none, jack o lantern back stripe b=\@pingu@none,jack o lantern back stripe c=\@pingu@none,jack o lantern height=6.25mm,jack o lantern width=6.1mm,hair=\@pingu@none},
  jack o lantern helmet/.default = pingu@bronze!97!pingu@black,
  jack o lantern stalk/.code     = \pingu@color{jackolantern@stalk}{#1},
  jack o lantern stalk top/.code = \pingu@color{jackolantern@stalk@top}{#1},
  jack o lantern background/.code= \pingu@color{jackolantern@background}{#1},
  jack o lantern stripe a/.code  = \pingu@color{jackolantern@stripe@a}{#1},
  jack o lantern stripe b/.code  = \pingu@color{jackolantern@stripe@b}{#1},
  jack o lantern stripe c/.code  = \pingu@color{jackolantern@stripe@c}{#1},
  jack o lantern back stripe a/.code  = \pingu@color{jackolantern@backstripe@a}{#1},
  jack o lantern back stripe b/.code  = \pingu@color{jackolantern@backstripe@b}{#1},
  jack o lantern back stripe c/.code  = \pingu@color{jackolantern@backstripe@c}{#1},
  jack o lantern outline/.code   = \pingu@color{jackolantern@outline}{#1},
  jack o lantern outline width/.code = \def\pingu@x@jackolantern@outline@w{#1},
  jack o lantern height/.code = \def\pingu@x@jackolantern@height{#1},
  jack o lantern width/.code = \def\pingu@x@jackolantern@width{#1},
  jack o lantern position/.code args  = {#1:(#2,#3)#4}{\def\pingu@x@jackolantern@angle{#1}\def\pingu@x@jackolantern@xshift{#2}\def\pingu@x@jackolantern@yshift{#3}\def\pingu@x@jackolantern@scale{#4}}
}{jack o lantern position={-9:(3.15mm,.95mm){1.3}},jack o lantern stripe a=pingu@black,jack o lantern stripe b=\pingu@color@jackolantern@stripe@a,jack o lantern stripe c=\pingu@color@jackolantern@stripe@b,jack o lantern back stripe a=pingu@black,jack o lantern back stripe b=\pingu@color@jackolantern@stripe@a,jack o lantern back stripe c=\pingu@color@jackolantern@stripe@b,jack o lantern outline=pingu@black,jack o lantern outline width=.7pt,jack o lantern stalk=pingu@green!95!\pingu@color@jackolantern!45!pingu@black,jack o lantern stalk top=\pingu@color@jackolantern@stalk!95!pingu@black,jack o lantern background=\pingu@color@jackolantern!85!pingu@black,jack o lantern height=5.5mm,jack o lantern width=5.75mm}

\def\pingu@jackolantern@outerpath{(0,.125cm)++(-60:{\pingu@x@jackolantern@width} and \pingu@x@jackolantern@height) arc(-60:86:{\pingu@x@jackolantern@width} and \pingu@x@jackolantern@height) to[bend right=3] ++(-3.75mm,0) arc(95:242:{\pingu@x@jackolantern@width} and \pingu@x@jackolantern@height) to[bend left=5] cycle;}
\def\pingu@x@jackolantern{(-5.15mm,.6mm) to[bend right] ++(1.5mm,-.5mm) -- ++(.33mm,.33mm) to[bend right=10] ++(1.5mm,0) -- ++(.66mm,-.75mm) -- ++(.66mm,.75mm) to[bend right=10] ++(1.5mm,0) -- ++(.33mm,-.33mm) to[bend right] ++(1.5mm,.5mm) to[bend left] ++(-1.5mm,-2.15mm) to[bend left=10] ++(-.33mm,.33mm) to[bend left=10] ++(-1.5mm,0) -- ++(-.66mm,-.5mm) -- ++(-.66mm,.5mm) to[bend left=10] ++(-1.5mm,0) -- ++(-.33mm,-.33mm) to[bend left] cycle}

\def\pingu@x@jackolantern@eye@left{(0.9mm,2mm) -- ++(2mm,-.15mm) to[bend right=40] ++(-.5mm,2mm) -- cycle}
\def\pingu@x@jackolantern@eye@right{(-3mm,2mm) -- ++(-2mm,-.15mm) to[bend left=40] ++(.5mm,2mm) -- cycle}
\def\pingu@x@jackolantern@nose{(0.965mm*0.5-3.225mm*0.5,1mm) -- ++(1mm,1.2mm) to[bend right=10] ++(-2mm,0) -- cycle}

\def\pingu@draw@ea@jackolantern{%
\scope[rotate around={\pingu@x@jackolantern@angle:(\pingu@name-head-top)},%
shift={(\pingu@name-head-top)},
shift={(\pingu@x@jackolantern@xshift,\pingu@x@jackolantern@yshift)},
scale=\pingu@x@jackolantern@scale]
\scope
\pgfinterruptboundingbox
\path[pingu@invclip]\pingu@x@jackolantern \pingu@x@jackolantern@eye@left \pingu@x@jackolantern@eye@right \pingu@x@jackolantern@nose;
  % give it a small cut
  \pingu@block{\pingu@color@jackolantern} (0,.125cm)++(-60:{\pingu@x@jackolantern@width} and \pingu@x@jackolantern@height) coordinate (@pkll) arc(-60:86: {\pingu@x@jackolantern@width} and \pingu@x@jackolantern@height) coordinate (@pkl) to[bend right=3] coordinate[pos=.5] (@pkuc) coordinate[pos=.225] (@pksl) coordinate[pos=.775] (@pksr) ++(-3.75mm,0) coordinate (@pkr) arc(95:242:{\pingu@x@jackolantern@width} and \pingu@x@jackolantern@height) coordinate (@pklr) to[bend left=5] coordinate[pos=.5] (@pklc) cycle;
  \pingu@draw[line join=round,line width=\pingu@x@jackolantern@outline@w]{\pingu@color@jackolantern@outline} \pingu@jackolantern@outerpath;
\endpgfinterruptboundingbox
\scope
\clip (0,.125cm)++(-60:{\pingu@x@jackolantern@width} and \pingu@x@jackolantern@height) arc(-60:86:{\pingu@x@jackolantern@width} and \pingu@x@jackolantern@height) to[bend right=3] ++(-3.75mm,0) arc(95:242:{\pingu@x@jackolantern@width} and \pingu@x@jackolantern@height) to[bend left=5] cycle;
  \pingu@draw[line cap=round,opacity=.2]{\pingu@color@jackolantern@stripe@a} (@pklr) to[bend left=42] (@pkr);
  \pingu@draw[line cap=round,opacity=.2]{\pingu@color@jackolantern@stripe@c} (@pkll) to[bend right=54] (@pkl);
  \pingu@draw[line cap=round,opacity=.2]{\pingu@color@jackolantern@stripe@b} (@pklc) to[bend right=6] (@pkuc);
\endscope
\endscope
  \pingu@draw[fill=\pingu@color@jackolantern@background,rounded corners=.25pt]{\pingu@color@jackolantern@outline} \pingu@x@jackolantern@eye@left;
  \pingu@draw[fill=\pingu@color@jackolantern@background,rounded corners=.25pt]{\pingu@color@jackolantern@outline} \pingu@x@jackolantern@eye@right;

  \pingu@draw[fill=\pingu@color@jackolantern@background,rounded corners=.25pt]{\pingu@color@jackolantern@outline} \pingu@x@jackolantern@nose;

  \pingu@draw[fill=\pingu@color@jackolantern@background]{\pingu@color@jackolantern@outline} \pingu@x@jackolantern;
  \scope
  \clip\pingu@x@jackolantern \pingu@x@jackolantern@eye@left \pingu@x@jackolantern@eye@right \pingu@x@jackolantern@nose;
  \pingu@draw[line cap=round,opacity=.2]{\pingu@color@jackolantern@backstripe@a} ([xshift=1.6mm]@pklr) to[bend left=18] (@pkr);
  \pingu@draw[line cap=round,opacity=.2]{\pingu@color@jackolantern@backstripe@c} ([xshift=-1.6mm]@pkll) to[bend right=22] (@pkl);
  \pingu@draw[line cap=round,opacity=.2]{\pingu@color@jackolantern@backstripe@b} (@pklc) to[bend right=1] (@pkuc);
  \endscope
  \pingu@block{\pingu@color@jackolantern@stalk} ([yshift=-.5*\pingu@x@jackolantern@outline@w]@pksl) to[bend left=3] ([yshift=-.5*\pingu@x@jackolantern@outline@w]@pksr) to[bend right=8] ++(.85mm,2mm) -- ++(.65mm,0) coordinate[pos=.5] (@pkc) to[bend right=3] cycle;
\pingu@block{\pingu@color@jackolantern@stalk@top} (@pkc) ellipse[x radius=.65mm/2, y radius=.085mm];
\endscope
}

\pingu@create@wing@extra{hammer}{%
    hammer \@lr/.code              = {\pingu@set@extra{hammer\@lr}{true}\pingu@color{hammer\@lr}{##1}},
    hammer \@lr/.default           = pingu@silver,
    hammer \@lr\space handle length/.code = \expandafter\def\csname pingu@hammer@\@lr @length\endcsname{##1},
    hammer \@lr\space handle shift/.code  = \expandafter\def\csname pingu@hammer@\@lr @shift\endcsname{##1},
    hammer \@lr\space width/.code  = \expandafter\def\csname pingu@hammer@\@lr @width\endcsname{##1},
    hammer \@lr\space height/.code  = \expandafter\def\csname pingu@hammer@\@lr @height\endcsname{##1},
    hammer \@lr\space xshift/.code  = \expandafter\def\csname pingu@hammer@\@lr @xshift\endcsname{##1},
    hammer \@lr\space yshift/.code  = \expandafter\def\csname pingu@hammer@\@lr @yshift\endcsname{##1},
    hammer \@lr\space handle/.code = \pingu@color{hammer@\@lr @handle}{##1},%
    hammer \@lr\space with knob/.style  = {hammer \@lr=##1, hammer \@lr\space handle length=\dimexpr9mm+\csname pingu@hammer@\@lr @height\endcsname+.5mm,hammer \@lr\space yshift=\dimexpr-.5mm-\csname pingu@hammer@\@lr @height\endcsname},
    hammer \@lr\space with knob/.default = pingu@silver
}{hammer \@lr\space handle length=9mm, hammer \@lr\space handle=pingu@bronze, hammer \@lr\space handle shift=-4mm, hammer \@lr\space width=7mm,hammer \@lr\space height=3.5mm, hammer \@lr\space xshift=-0.5*\csname pingu@hammer@\@lr @width\endcsname,hammer \@lr\space yshift=-1mm}
\def\pingu@draw@wi@hammer#1{%
    \pingu@setup@wing{hammer}{#1}%
\scope[rotate around={\@angle:(\pingu@name-wing-#1)}]
% \csname pingu@color@hammer#1\endcsname
    \pingu@block{\csname pingu@color@hammer@#1@handle\endcsname}(\pingu@name-wing-#1)++(\@sidesign*-.2mm,\csname pingu@hammer@#1@shift\endcsname) -- ++(0,\csname pingu@hammer@#1@length\endcsname) arc(180:0:\@sidesign*.4mm and .3mm) coordinate[pos=.5] (\pingu@name-hammer-#1-top) -- ++(0,-\csname pingu@hammer@#1@length\endcsname) arc(360:180:\@sidesign*.4mm and .3mm) -- cycle;
    \pingu@block[rounded corners=2pt]{\csname pingu@color@hammer#1\endcsname} (\pingu@name-hammer-#1-top)++(\csname pingu@hammer@#1@xshift\endcsname,\csname pingu@hammer@#1@yshift\endcsname) rectangle ++(\csname pingu@hammer@#1@width\endcsname,\csname pingu@hammer@#1@height\endcsname);
\endscope
}

\pingu@create@wing@extra{plank}{%
    plank \@lr/.code              = {\pingu@set@extra{plank\@lr}{true}\pingu@color{plank\@lr}{##1}},
    plank \@lr/.default           = pingu@bronze!80!pingu@black,
    plank \@lr\space width/.code  = \expandafter\def\csname pingu@plank@\@lr @width\endcsname{##1},
    plank \@lr\space height/.code  = \expandafter\def\csname pingu@plank@\@lr @height\endcsname{##1},
    plank \@lr\space xshift/.code  = \expandafter\def\csname pingu@plank@\@lr @xshift\endcsname{##1},
    plank \@lr\space yshift/.code  = \expandafter\def\csname pingu@plank@\@lr @yshift\endcsname{##1}
}{plank \@lr\space width=7mm,plank \@lr\space height=16.5mm, plank \@lr\space xshift=0mm,plank \@lr\space yshift=-1mm}
\def\pingu@draw@wi@plank#1{%
    \pingu@setup@wing{plank}{#1}%
\scope[rotate around={\@angle:(\pingu@name-wing-#1)}]
\pingu@block[rounded corners=2pt]{\@col}([xshift=\csname pingu@plank@#1@xshift\endcsname,yshift=\csname pingu@plank@#1@yshift\endcsname]\pingu@name-wing-#1)++({-.5*(\csname pingu@plank@#1@width\endcsname)},{-.5*(\csname pingu@plank@#1@height\endcsname)}) rectangle ++({\csname pingu@plank@#1@width\endcsname},{\csname pingu@plank@#1@height\endcsname});
\endscope
}

% \usetikzlibrary{spy}

\pingu@create@wing@extra{magnifier}{%
    magnifier \@lr/.code              = {\pingu@set@extra{magnifier\@lr}{true}\pingu@color{magnifier\@lr}{##1}}, % \noexpand\tikzset{/pingu/@pingu/.append style={spy scope={circle,draw,magnification=4,size=1cm}}}
    magnifier \@lr/.default           = pingu@bronze,
    magnifier \@lr\space handle length/.code = \expandafter\def\csname pingu@magnifier@\@lr @length\endcsname{##1},
    magnifier \@lr\space handle shift/.code  = \expandafter\def\csname pingu@magnifier@\@lr @shift\endcsname{##1},
    magnifier \@lr\space size/.code  = \expandafter\def\csname pingu@magnifier@\@lr @size\endcsname{##1},
    magnifier \@lr\space glass/.code  = \pingu@color{magnifier@\@lr @glass}{##1},
    magnifier \@lr\space opacity/.code  = \expandafter\def\csname pingu@magnifier@\@lr @opacity\endcsname{##1},
    magnifier \@lr\space thick/.code  = \expandafter\def\csname pingu@magnifier@\@lr @thick\endcsname{##1},
    magnifier \@lr\space xshift/.code  = \expandafter\def\csname pingu@magnifier@\@lr @xshift\endcsname{##1},
    magnifier \@lr\space yshift/.code  = \expandafter\def\csname pingu@magnifier@\@lr @yshift\endcsname{##1},
    magnifier \@lr\space handle/.code = \pingu@color{magnifier@\@lr @handle}{##1}%
}{magnifier \@lr\space handle length=3.5mm, magnifier \@lr\space handle shift=-4mm, magnifier \@lr\space xshift=0mm,magnifier \@lr\space yshift=1mm,magnifier \@lr\space size=2.5mm,magnifier \@lr\space thick=.5mm,magnifier \@lr\space glass=pingu@blue!90!pingu@yellow,magnifier \@lr\space opacity=0.24}
\def\pingu@draw@wi@magnifier#1{%
    \pingu@setup@wing{magnifier}{#1}%
  \scope[rotate around={\@angle:(\pingu@name-wing-#1)}]
% \csname pingu@color@magnifier#1\endcsname
  \path ([yshift=\csname pingu@magnifier@#1@yshift\endcsname+\csname pingu@magnifier@#1@size\endcsname,xshift=\csname pingu@magnifier@\@lr @xshift\endcsname]\pingu@name-wing-#1) coordinate (@);

  % \spy[draw=green] on (@) in node at (@);
% \pgfonlayer{foreground}
  \pingu@block[even odd rule]{\@col} (@) circle[radius=\csname pingu@magnifier@#1@size\endcsname] circle[radius=\csname pingu@magnifier@#1@size\endcsname-\csname pingu@magnifier@#1@thick\endcsname];

    \pingu@block[opacity=\csname pingu@magnifier@#1@opacity\endcsname]{\csname pingu@color@magnifier@#1@glass\endcsname} (@) circle[radius=\csname pingu@magnifier@#1@size\endcsname-\csname pingu@magnifier@#1@thick\endcsname];

    \pingu@block{\@col} % TODO: adapt size
    (@) ([shift={(-70:2.5mm)}]@) to[out=230,in=90] ++(-.5mm,-\csname pingu@magnifier@#1@length\endcsname) arc(360:180:.33mm) to[out=90,in=-50] ++(-.5mm,\csname pingu@magnifier@#1@length\endcsname);%
% \endpgfonlayer
\endscope
}