% Florian Sihler, 2022
% Licensed under GNU General Public License version 3
% https://opensource.org/licenses/gpl-3.0.html
% TODO: get all of this customizable
\colorlet{base@a}{lightgray!95!black}
\colorlet{base@b}{lightgray!79!black}

\colorlet{a}{lightgray!63!black}
\colorlet{b}{lightgray!81!black}
\def\basew{12}
\def\pingu@@horse@scale{.1}

\def\pingu@@horse@@main{(1.275,.55) -- ++(\if@pingu@@horse@@donkey@.05\else.1\fi,.2) -- ++(\if@pingu@@horse@@donkey@-.2\else-.25\fi,.25) to[bend right=4] ++(-.425,1.75) to[bend left=15] ++(.05,.2) to[bend right=30] ++(-.1,1.9) to[bend left=30] ++(0,1.65) coordinate(@back) to[bend left=30] ++(2,.625) to[bend right=18,looseness=.8] ++(3.25,-.1) [rounded corners=2*\pingu@@horse@scale] coordinate(@hair) to[out=34,in=185] ++(3,1.3) to[bend left=19] coordinate[pos=.5](@ear) ++(.85,-.4) to[bend left=5] ++(.24,-.45) to[bend right=20] ++(\if@pingu@@horse@@donkey@.25\else0\fi,\if@pingu@@horse@@donkey@-1.2\else-.7\fi) to[bend left=2] ++(.1,-.55) to[out=-85,in=-60,looseness=.75] ++(\if@pingu@@horse@@donkey@-.55\else-.475\fi,\if@pingu@@horse@@donkey@-.45\else-.35\fi) coordinate(@mouth) to[out=-135,in=-120] ++(\if@pingu@@horse@@donkey@-.4\else-.37\fi,\if@pingu@@horse@@donkey@.2\else.25\fi) -- ++(0,.1)
to[out=125,in=-68] ++(-.58,.615) coordinate (@mouth-low)
to[out=215,in=80] ++(-1.25,-2) to[bend left=24] ++(-.65,-1) to[out=258,in=86] ++(-.42,-1.25)  to[bend left=3] ++(-.2,-.6) to[bend right=10] ++(-.14,-1.15) to[bend left=2] coordinate[pos=.62] (@hooffront) ++(.355,-.565) to[bend left=15] ++(-.4,-.075) to[bend left=10] ++(-.28,.1) to[bend left=9] ++(.06,.3) to[bend right=9] ++(-.2,.4) to[out=80,in=-80] ++(.138,1.4) to[out=70,in=-103] ++(.2,1.3) to[bend right=10] ++(-.225,.44) coordinate (@frontleg) to[out=196,in=\if@pingu@@horse@@donkey@-65\else-25\fi] ++(-3.3,\if@pingu@@horse@@donkey@.4\else.575\fi) coordinate (@backleg) to[bend right=\if@pingu@@horse@@donkey@16\else10\fi] ++(-.8,\if@pingu@@horse@@donkey@-1.375\else-1.5\fi) to[bend right=\if@pingu@@horse@@donkey@9\else20\fi] ++(.1,-2.35) -- ++(\if@pingu@@horse@@donkey@.1\else.2\fi,-.25)
coordinate (@hoofback) to[bend right=\if@pingu@@horse@@donkey@9\else8\fi] ++(.15,-.26) to[bend left=10] ++(\if@pingu@@horse@@donkey@-.66\else-.55\fi,\if@pingu@@horse@@donkey@-.15\else-.05\fi) -- cycle}

% #1 is the wing for the color and key assignments
\def\pingu@@drawer@horse#1{
% this ensures all coordinates are set in place
% i know this i inefficient, but atm this is of no greater
% concern -- i can not use layers as they would clash with that
% of the penguin and who wants that... no one does!
% penguins deserve freedom!
\path \pingu@@horse@@main;

% no we draw "behind" the horse:

% Sockel
\csname if@pingu@x@horse@#1@base@\endcsname
\pingu@block[draw=\csname pingu@color@horse#1@base@shade@draw\endcsname,line width=\@pingu@@horse@lw*\pingu@@horse@scale]{\csname pingu@color@horse#1@base@shade\endcsname} (4.35-\basew/2,.433) -- ++(0,-.5) arc(180:360:\basew/2 and 1) -- ++(0,.5) arc(360:180:\basew/2 and 1);
\pingu@block[draw=\csname pingu@color@horse#1@base@draw\endcsname,line width=\@pingu@@horse@lw*\pingu@@horse@scale]{\csname pingu@color@horse#1@base\endcsname} (4.35,.433) ellipse[x radius=\basew/2,y radius=1];
\fi
% background front leg
\pingu@block[draw=\csname pingu@color@horse#1@draw\endcsname,line width=\@pingu@@horse@lw*\pingu@@horse@scale]{\csname pingu@color@horse#1\endcsname} [rounded corners=1*\pingu@@horse@scale](@frontleg) to[out=266,in=85] ++(.09,-.5) to[bend left=10] ++(-.15,-.8)
to[bend right=7] ++(-.05,-.2) to[bend left=13] ++(-.2,-1.15) to[bend right=13] ++(.15,-.2) to[bend left=10] ++(-.07,-.3)  to[bend right=100] ++(.45,-.1) to[bend right=10] coordinate[pos=0.08](@hooffront@) ([yshift=5mm,xshift=3mm]@frontleg) -- cycle;
\pingu@block[draw=\csname pingu@color@horse#1@fr@hoof\endcsname!80!pingu@black,line width=2pt*\pingu@@horse@scale,rounded corners=.12]{\csname pingu@color@horse#1@fr@hoof\endcsname} (@hooffront@) to[bend left=2] ++(0,-.565*.665) to[bend left=59] ++(-.225,-.08) -- ++(-.02,.03) to[bend left=20] ++(-.315,.11) to[bend right=6] ++(.092,.2) to[bend right=25] cycle;
% background back le0
\pingu@block[draw=\csname pingu@color@horse#1@draw\endcsname,line width=\@pingu@@horse@lw*\pingu@@horse@scale]{\csname pingu@color@horse#1\endcsname} [rounded corners=1*\pingu@@horse@scale](@backleg) to[out=-115,in=\if@pingu@@horse@@donkey@120\else130\fi] ++(-.3,-3.5) -- ++(.2,-.3) coordinate(@hoofback@) to[bend left] ++(-.5,-.1)
-- ++(\if@pingu@@horse@@donkey@-.2\else-.05\fi,.15) -- ++(0,.15) to[bend left=\if@pingu@@horse@@donkey@45\else60\fi] cycle;
\pingu@block[draw=\csname pingu@color@horse#1@br@hoof\endcsname!80!pingu@black,line width=2pt*\pingu@@horse@scale]{\csname pingu@color@horse#1@br@hoof\endcsname} (@hoofback@) to[bend right=\if@pingu@@horse@@donkey@9\else9\fi] ++(.206,-.265) to[bend left=10] ++(\if@pingu@@horse@@donkey@-.66\else-.55\fi,\if@pingu@@horse@@donkey@-.15\else-.05\fi) -- ++(-1.73mm,2.42mm) to[bend right=6] cycle;

\if@pingu@@horse@@donkey@
\pingu@block[draw=\csname pingu@color@horse#1@tail@draw\endcsname,line width=\@pingu@@horse@lw*\pingu@@horse@scale]{\csname pingu@color@horse#1@tail\endcsname} [rounded corners=1*\pingu@@horse@scale](@back) to[out=215,in=95] ++(-.1,-2) to[out=270,in=92] ++(0,-.75) [sharp corners] to[bend right=20] coordinate[pos=.5] (@) ++(.15,0) to[bend right=10] cycle;
% TODO: hide support
%\node[draw=\csname pingu@color@horse#1@tail@draw\endcsname,fill=\csname pingu@color@horse#1@tail\endcsname,cloud,cloud puffs=30,cloud ignores aspect,scale=1.33*\pingu@@horse@scale,yshift=16mm,rotate=-5,line width=\@pingu@@horse@lw*\pingu@@horse@scale] at (@) {\rotatebox{90}{\phantom{A}\hskip7.5em}};
\scope[rotate around={180:(@)}] % adapted from the broom
\pingu@block[rounded corners=.44pt,draw=\csname pingu@color@horse#1@tail@draw\endcsname]{\csname pingu@color@horse#1@tail\endcsname} (@)++(-1mm,-2mm) to[out=115,in=240] ++(3mm,12.5mm) to[out=300,in=65] ([xshift=.95mm,yshift=-2mm]@) to[bend right=4] ([xshift=-.75mm,yshift=-2mm]@) -- cycle;
\pingu@block[rounded corners=.44pt,draw=\csname pingu@color@horse#1@tail@draw\endcsname]{\csname pingu@color@horse#1@tail\endcsname} (@)++(-1mm,-2mm) to[out=115,in=240] coordinate[pos=.17] (@r) coordinate[pos=.19] (@r2)  ++(-.75mm,10.5mm) to[out=300,in=65] ([xshift=.95mm,yshift=-2mm]@) to[bend right=4] ([xshift=-.75mm,yshift=-2mm]@) -- cycle;
\pingu@block[rounded corners=.44pt,draw=\csname pingu@color@horse#1@tail@draw\endcsname]{\csname pingu@color@horse#1@tail\endcsname}(@)++(-.5mm,-1.5mm) to[out=115,in=240] ++(.5mm,12mm) to[out=300,in=65] ([xshift=.5mm,yshift=-1.5mm]@) -- cycle;
\endscope
\else
\pingu@block[draw=\csname pingu@color@horse#1@tail@draw\endcsname,line width=\@pingu@@horse@lw*\pingu@@horse@scale]{\csname pingu@color@horse#1@tail\endcsname} [rounded corners=1*\pingu@@horse@scale](@back) to[out=215,in=90] ++(-.4,-2.5) to[out=270,in=92] ++(0,-2.8) [sharp corners] to[bend right=20] ++(.6,0) to[bend right=10] cycle;
\fi

% back ear
\if@pingu@@horse@@donkey@
\pingu@block[draw=\csname pingu@color@horse#1@draw\endcsname,line width=\@pingu@@horse@lw*\pingu@@horse@scale]{\csname pingu@color@horse#1@ears\endcsname} ([xshift=.2mm,yshift=-1.5mm]@ear) to[bend left=20] ++(.373,1.465) coordinate(@) to[bend left=10] ++(-.15,-1.5);
\else
\pingu@block[draw=\csname pingu@color@horse#1@draw\endcsname,line width=\@pingu@@horse@lw*\pingu@@horse@scale]{\csname pingu@color@horse#1@ears\endcsname} ([xshift=.2mm,yshift=-1.5mm]@ear) to[bend left=20] ++(.373,.565) coordinate(@) to[bend left=10] ++(-.15,-.75);
\fi
% and here comes the wheeee (imagine-horse-sound)
\pingu@block[draw=\csname pingu@color@horse#1@draw\endcsname,line width=\@pingu@@horse@lw*\pingu@@horse@scale]{\csname pingu@color@horse#1\endcsname} [rounded corners=1*\pingu@@horse@scale] \pingu@@horse@@main;

\pingu@draw[line width=\@pingu@@horse@lw*\pingu@@horse@scale]{\csname pingu@color@horse#1@draw\endcsname} ([yshift=-.1mm]@mouth-low) to[bend left=12] ++(.06,.65);
\pingu@draw[line width=\@pingu@@horse@lw*\pingu@@horse@scale]{\csname pingu@color@horse#1@mouth\endcsname} ([yshift=-.115mm]@mouth) -- ++(-.035,.225);

\edef\pingu@tmp{\if@pingu@@horse@@donkey@4.5mm\else3.85mm\fi}%
\edef\pingu@tmpb{\if@pingu@@horse@@donkey@3.65mm\else2.45mm\fi}%
\pingu@draw[line width=\@pingu@@horse@lw*\pingu@@horse@scale,line join=round]{\csname pingu@color@horse#1@nose\endcsname} ([xshift=\pingu@tmp,yshift=\pingu@tmpb]@mouth) to[out=140,in=10] ++(-.17,-.074) to[bend right=49] cycle;

\pingu@draw[line width=\@pingu@@horse@lw*\pingu@@horse@scale]{\csname pingu@color@horse#1@draw\endcsname} ([yshift=-.35mm]@frontleg) to[bend left=12] ++(.01,.325);
\pingu@draw[line width=\@pingu@@horse@lw*\pingu@@horse@scale]{\csname pingu@color@horse#1@draw\endcsname} ([yshift=-.2mm]@backleg) to[bend right=13] ++(.25,.425);

\if@pingu@@horse@@donkey@
\pingu@block[draw=\csname pingu@color@horse#1@mane@draw\endcsname,line width=\@pingu@@horse@lw*\pingu@@horse@scale]{\csname pingu@color@horse#1@mane\endcsname} [rounded corners=1*\pingu@@horse@scale](@hair) to[out=34,in=185] ++(3,1.3) to[bend left=10] ++(.415,-.1) -- ++(-.1,-.25) to[out=186,in=35] ([yshift=-4mm,xshift=1.5mm]@hair) -- cycle;

\pingu@block[draw=\csname pingu@color@horse#1@thatch@draw\endcsname,line width=\@pingu@@horse@lw*\pingu@@horse@scale]{\csname pingu@color@horse#1@thatch\endcsname} [rounded corners=1*\pingu@@horse@scale]([xshift=2.1mm,yshift=-1.05mm]@ear) -- ++(-.1,-.2) to[bend left=4] ++(.45,-.275) to[bend right=9] cycle;
\else
\pingu@block[draw=\csname pingu@color@horse#1@mane@draw\endcsname,line width=\@pingu@@horse@lw*\pingu@@horse@scale]{\csname pingu@color@horse#1@mane\endcsname} [rounded corners=1*\pingu@@horse@scale](@hair) to[out=34,in=185] ++(3,1.3) to[bend left=10] ++(.415,-.1) -- ++(-.1,-.4) to[out=194,in=30] ([yshift=-11.5mm,xshift=1.5mm]@hair) -- cycle;

\pingu@block[draw=\csname pingu@color@horse#1@thatch@draw\endcsname,line width=\@pingu@@horse@lw*\pingu@@horse@scale]{\csname pingu@color@horse#1@thatch\endcsname} [rounded corners=1*\pingu@@horse@scale]([xshift=2mm,yshift=-1mm]@ear) -- ++(-.1,-.3275) to[bend left=4] ++(.455,-.175) to[bend right=9] cycle;
\fi

% ear
\if@pingu@@horse@@donkey@
\pingu@block[draw=\csname pingu@color@horse#1@draw\endcsname,line width=\@pingu@@horse@lw*\pingu@@horse@scale]{\csname pingu@color@horse#1@ears\endcsname} ([xshift=-1mm,yshift=-1mm]@ear) to[bend left=15] ++(.393,1.685) coordinate(@) to[bend right=17] ++(-.15,-1.8);
\pingu@block[draw=\csname pingu@color@horse#1@draw\endcsname,line width=\@pingu@@horse@lw*\pingu@@horse@scale]{\csname pingu@color@horse#1@ears\endcsname} (@) to[bend right=17] ++(-.15,-1.8) to[bend right=14] cycle;
\else
\pingu@block[draw=\csname pingu@color@horse#1@draw\endcsname,line width=\@pingu@@horse@lw*\pingu@@horse@scale]{\csname pingu@color@horse#1@ears\endcsname} ([xshift=-.75mm,yshift=-1mm]@ear) to[bend left=20] ++(.393,.585) coordinate(@) to[bend right=10] ++(-.15,-.7);
\pingu@block[draw=\csname pingu@color@horse#1@draw\endcsname,line width=\@pingu@@horse@lw*\pingu@@horse@scale]{\csname pingu@color@horse#1@ears\endcsname} (@) to[bend right=7] ++(-.15,-.7) to[bend right=14] cycle;
\fi

% the eye; this is no error it has draw as fill
\pingu@block{\csname pingu@color@horse#1@eyes\endcsname} [rounded corners=.25*\pingu@@horse@scale] ([xshift=3mm,yshift=-7.5mm]@ear) to[bend right=20] ++(.125,-.2) to[bend right=50] ++(.1,.125) to[bend left=15] cycle;

\pingu@block[draw=\csname pingu@color@horse#1@fl@hoof\endcsname!80!pingu@black,line width=2pt*\pingu@@horse@scale]{\csname pingu@color@horse#1@fl@hoof\endcsname} (@hooffront) to[bend left=2] ++(.355*.49,-.545*.49) to[bend left=11] ++(-.45-.295,-.05+0.033)to[bend right=2] ++(.046,.29) to[bend right=10] cycle;
\pingu@block[draw=\csname pingu@color@horse#1@bl@hoof\endcsname!80!pingu@black,line width=2pt*\pingu@@horse@scale]{\csname pingu@color@horse#1@bl@hoof\endcsname} (@hoofback) to[bend right=\if@pingu@@horse@@donkey@9\else8\fi] ++(.15,-.26) to[bend left=10] ++(\if@pingu@@horse@@donkey@-.66\else-.55\fi,\if@pingu@@horse@@donkey@-.15\else-.05\fi) -- ++(-1.73mm,2.42mm) to[bend right=6] cycle; %to[bend left=2] ++(.355*.65,-.565*.65) to[bend left=15] ++(-.395,-.075) to[bend left=10] ++(-.293,.105) to[bend left=9] ++(.06,.3) to[bend left=5] cycle;
}

% universal switch for all three positions
\newif\if@pingu@@horse@@donkey@

\newif\if@pingu@x@horse@left@flip@
\newif\if@pingu@x@horse@right@flip@
\newif\if@pingu@x@horse@left@base@
\newif\if@pingu@x@horse@right@base@
\newif\if@pingu@x@horse@left@donkey@
\newif\if@pingu@x@horse@right@donkey@
\pingu@create@wing@extra{horse}{%
    horse \@lr/.code                       = {\pingu@set@extra{horse\@lr}{true}\pingu@color{horse\@lr}{##1}},
    horse \@lr/.default                    = pingu@bronze!80!pingu@black,
    horse \@lr\space flip/.is if           = @pingu@x@horse@\@lr @flip@,
    horse \@lr\space donkey/.is if         = @pingu@x@horse@\@lr @donkey@,
    horse \@lr\space has base/.is if       = @pingu@x@horse@\@lr @base@,
    horse \@lr\space draw/.code            = \pingu@color{horse\@lr @draw}{##1},%
    horse \@lr\space line width/.code      = \@namedef{pingu@horse\@lr @x@line@width}{##1},%
    horse \@lr\space mane/.code            = \pingu@color{horse\@lr @mane}{##1},%
    horse \@lr\space mane draw/.code       = \pingu@color{horse\@lr @mane@draw}{##1},%
    horse \@lr\space thatch/.code          = \pingu@color{horse\@lr @thatch}{##1},%
    horse \@lr\space thatch draw/.code     = \pingu@color{horse\@lr @thatch@draw}{##1},%
    horse \@lr\space tail/.code            = \pingu@color{horse\@lr @tail}{##1},%
    horse \@lr\space tail draw/.code       = \pingu@color{horse\@lr @tail@draw}{##1},%
    horse \@lr\space eyes/.code            = \pingu@color{horse\@lr @eyes}{##1},%
    horse \@lr\space eye/.forward to       = /pingu/horse \@lr\space eyes,%
    horse \@lr\space mouth/.code           = \pingu@color{horse\@lr @mouth}{##1},%
    horse \@lr\space nose/.code            = \pingu@color{horse\@lr @nose}{##1},%
    horse \@lr\space ears/.code            = \pingu@color{horse\@lr @ears}{##1},%
    horse \@lr\space base/.code            = \pingu@color{horse\@lr @base}{##1},%
    horse \@lr\space base draw/.code       = \pingu@color{horse\@lr @base@draw}{##1},%
    horse \@lr\space base shade/.code      = \pingu@color{horse\@lr @base@shade}{##1},%
    horse \@lr\space base shade draw/.code = \pingu@color{horse\@lr @base@shade@draw}{##1},%
    horse \@lr\space front left hoof/.code = \pingu@color{horse\@lr @fl@hoof}{##1},%
    horse \@lr\space front right hoof/.code= \pingu@color{horse\@lr @fr@hoof}{##1},%
    horse \@lr\space back left hoof/.code  = \pingu@color{horse\@lr @bl@hoof}{##1},%
    horse \@lr\space back right hoof/.code = \pingu@color{horse\@lr @br@hoof}{##1},%
    horse \@lr\space front hoofs/.style    = {/pingu/horse \@lr\space front left hoof=##1,/pingu/horse \@lr\space front right hoof=##1},
    horse \@lr\space back hoofs/.style     = {/pingu/horse \@lr\space back left hoof=##1,/pingu/horse \@lr\space back right hoof=##1},
    horse \@lr\space hoofs/.style          = {/pingu/horse \@lr\space front hoofs=##1,/pingu/horse \@lr\space back hoofs=##1},
    horse \@lr\space hoofs/.default        = gray!80!white,
    % TODO: allow colors to be styles?
    horse \@lr\space xshift/.code          = \@namedef{pingu@x@horse\@lr @xshift}{##1},
    horse \@lr\space yshift/.code          = \@namedef{pingu@x@horse\@lr @yshift}{##1},
    horse \@lr\space on base/.style        ={/pingu/horse \@lr\space yshift=4cm},
}{horse \@lr\space draw=\csname pingu@color@horse\@lr\endcsname!80!pingu@black,horse \@lr\space mane=\csname pingu@color@horse\@lr\endcsname!86!pingu@white,horse \@lr\space mane draw=\csname pingu@color@horse\@lr @mane\endcsname!80!pingu@black,horse \@lr\space eyes=\csname pingu@color@horse\@lr @draw\endcsname,horse \@lr\space mouth=\csname pingu@color@horse\@lr @draw\endcsname,horse \@lr\space nose=\csname pingu@color@horse\@lr @draw\endcsname,horse \@lr\space ears=\csname pingu@color@horse\@lr\endcsname,horse \@lr\space thatch=\csname pingu@color@horse\@lr @mane\endcsname,horse \@lr\space thatch draw=\csname pingu@color@horse\@lr @thatch\endcsname!80!pingu@black,horse \@lr\space tail=\csname pingu@color@horse\@lr @mane\endcsname,horse \@lr\space tail draw=\csname pingu@color@horse\@lr @tail\endcsname!80!pingu@black,horse \@lr\space has base=false,horse \@lr\space base=lightgray!90!black,horse \@lr\space base draw=\csname pingu@color@horse\@lr @base\endcsname!91!pingu@black,horse \@lr\space base shade=lightgray!80!black,horse \@lr\space base shade draw=\csname pingu@color@horse\@lr @base@shade\endcsname!91!pingu@black,horse \@lr\space xshift=0pt,horse \@lr\space yshift=0pt,horse \@lr\space flip=\ifx\@lr\pingu@str@wing@left true\else false\fi,horse \@lr\space donkey=false,horse \@lr\space line width=1.75pt,horse \@lr\space hoofs=\@pingu@none}

\def\pingu@draw@wi@horse#1{%
    \pingu@setup@wing{horse}{#1}%
\scope[scale=\pingu@@horse@scale,every path/.append style={line cap=round, line join=round},shift=(\pingu@name-wing-#1),rotate around={\@angle-5:(\pingu@name-wing-#1)}]
\csname if@pingu@x@horse@#1@flip@\endcsname
\scope[xshift=-4cm-\csname pingu@x@horse#1@xshift\endcsname,yshift=-42mm+\csname pingu@x@horse#1@yshift\endcsname]
\else
\scope[xshift=4cm+\csname pingu@x@horse#1@xshift\endcsname,yshift=-42mm+\csname pingu@x@horse#1@yshift\endcsname,xscale=-1]
\fi
\csname if@pingu@x@horse@#1@donkey@\endcsname
    \@pingu@@horse@@donkey@true
\fi
    \edef\@pingu@@horse@lw{\csname pingu@horse#1@x@line@width\endcsname}
    \pingu@@drawer@horse{#1}
    % TODO-SET: hoof
\endscope\endscope
}
% todo: make statue extra
% todo: make horse hat

% to get on horse we create some kind of third wing item: 'on'
% that will be used to initialize all of the colors and keys
\newif\if@pingu@x@horse@on@flip@
\newif\if@pingu@x@horse@on@base@
\newif\if@pingu@x@horse@on@boundingbox@
\newif\if@pingu@x@horse@on@donkey@
% TODO: select keys
% TODO: option so it does not affect the bounding box (default!)
\pingu@create@extra{horseon}{%
    on horse/.code                  = {\pingu@set@extra{horseon}{true}\pingu@color{horseon}{#1}},
    on horse/.default               = pingu@bronze!80!pingu@black,
    horse behind/.style             = {on horse=#1, on horse scale=.325, on horse yshift=6.15cm},
    horse behind/.default           = pingu@bronze!80!pingu@black,
    on horse flip/.is if            = @pingu@x@horse@on@flip@,
    on horse donkey/.is if          = @pingu@x@horse@on@donkey@,
    on horse has base/.is if        = @pingu@x@horse@on@base@,
    on horse has bounding box/.is if = @pingu@x@horse@on@boundingbox@,
    on horse draw/.code             = \pingu@color{horseon@draw}{#1},%
    on horse line width/.code       = \@namedef{pingu@horseon@x@line@width}{#1},%
    on horse mane/.code             = \pingu@color{horseon@mane}{#1},%
    on horse mane draw/.code        = \pingu@color{horseon@mane@draw}{#1},%
    on horse thatch/.code           = \pingu@color{horseon@thatch}{#1},%
    on horse thatch draw/.code      = \pingu@color{horseon@thatch@draw}{#1},%
    on horse tail/.code             = \pingu@color{horseon@tail}{#1},%
    on horse tail draw/.code        = \pingu@color{horseon@tail@draw}{#1},%
    on horse eyes/.code             = \pingu@color{horseon@eyes}{#1},%
    on horse eye/.forward to        = /pingu/on horse eyes,%
    on horse mouth/.code            = \pingu@color{horseon@mouth}{#1},%
    on horse nose/.code             = \pingu@color{horseon@nose}{#1},%
    on horse ears/.code             = \pingu@color{horseon@ears}{#1},%
    on horse base/.code             = \pingu@color{horseon@base}{#1},%
    on horse base draw/.code        = \pingu@color{horseon@base@draw}{#1},%
    on horse base shade/.code       = \pingu@color{horseon@base@shade}{#1},%
    on horse base shade draw/.code  = \pingu@color{horseon@base@shade@draw}{#1},%
    on horse front left hoof/.code  = \pingu@color{horseon@fl@hoof}{#1},%
    on horse front right hoof/.code = \pingu@color{horseon@fr@hoof}{#1},%
    on horse back left hoof/.code   = \pingu@color{horseon@bl@hoof}{#1},%
    on horse back right hoof/.code  = \pingu@color{horseon@br@hoof}{#1},%
    on horse front hoofs/.style     = {/pingu/on horse front left hoof=#1,/pingu/on horse front right hoof=#1},
    on horse back hoofs/.style      = {/pingu/on horse back left hoof=#1,/pingu/on horse back right hoof=#1},
    on horse hoofs/.style           = {/pingu/on horse front hoofs=#1,/pingu/on horse back hoofs=#1},
    on horse hoofs/.default         = gray!80!white,
    on horse xshift/.code           = \@namedef{pingu@x@horseon@xshift}{#1},
    on horse yshift/.code           = \@namedef{pingu@x@horseon@yshift}{#1},
    on horse scale/.code            = \@namedef{pingu@x@horseon@scale}{#1}
}{on horse draw=\pingu@color@horseon!80!pingu@black,on horse mane=\pingu@color@horseon!86!pingu@white,on horse mane draw=\pingu@color@horseon@mane!80!pingu@black,on horse eyes=\pingu@color@horseon@draw,on horse mouth=\pingu@color@horseon@draw,on horse nose=\pingu@color@horseon@draw,on horse ears=\pingu@color@horseon,on horse thatch=\pingu@color@horseon@mane,on horse thatch draw=\pingu@color@horseon@thatch!80!pingu@black,on horse tail=\pingu@color@horseon@mane,on horse tail draw=\pingu@color@horseon@tail!80!pingu@black,on horse has base=false,on horse base=lightgray!90!black,on horse base draw=\pingu@color@horseon@base!91!pingu@black,on horse base shade=lightgray!80!black,on horse base shade draw=\pingu@color@horseon@base@shade!91!pingu@black,on horse xshift=0pt,on horse yshift=0pt,on horse flip=false,on horse scale=0.75,on horse has bounding box=false,on horse donkey=false,on horse line width=1.75pt,on horse hoofs=\@pingu@none}


\def\pingu@draw@eb@horseon{%
\pingu@layer{background}[scale=\pingu@x@horseon@scale,every path/.append style={line cap=round, line join=round},shift=(\pingu@name-bottom-center)]
\if@pingu@x@horse@on@donkey@
    \@pingu@@horse@@donkey@true
\fi
\if@pingu@x@horse@on@flip@
 \scope[xshift=-45mm-\pingu@x@horseon@xshift,yshift=-67mm+\pingu@x@horseon@yshift,xscale=\if@pingu@x@horse@on@donkey@ 1.1\else1\fi,yscale=\if@pingu@@horse@@donkey@.9\else1\fi]
 \else
 \scope[xshift=45mm+\pingu@x@horseon@xshift,yshift=-67mm+\pingu@x@horseon@yshift,xscale=\if@pingu@x@horse@on@donkey@-1.1\else-1\fi,yscale=\if@pingu@@horse@@donkey@.9\else1\fi]
 \fi
\edef\@pingu@@horse@lw{\pingu@horseon@x@line@width}
\if@pingu@x@horse@on@boundingbox@\else\pgfinterruptboundingbox\fi
    \pingu@@drawer@horse{on}
\if@pingu@x@horse@on@boundingbox@\else\endpgfinterruptboundingbox\fi
\endscope\endpingu@layer
}