%% Copyright 2016 Nils Fleischhacker
%%
%% This work may be distributed and/or modified under the 
%% conditions of the LaTeX Project Public License, either 
%% version 1.3 of this license or (at your option) any later 
%% version. The latest version of this license is in
%%
%%   http://www.latex-project.org/lppl.txt
%%
%% and version 1.3 or later is part of all distributions of 
%% LaTeX version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%% 
%% The Current Maintainer of this work is Nils Fleischhacker.
\tikzpeople@addcolorkey{tie}

\newcommand{\tikzpeople@dave@paint}{
	\tikzpeople@person@paintshirt
	\tikzpeople@dave@paintundershirt
	\tikzpeople@person@paintrighthorn
	\tikzpeople@person@painthead
	\tikzpeople@dave@painthair
	\tikzpeople@person@paintgoatee
	\tikzpeople@person@paintlefthorn
	\tikzpeople@person@painthalo
}

\newcommand{\tikzpeople@dave@definecolors}{
	\definecolor{shirt}{RGB}{136,190,226}
	\definecolor{tie}{RGB}{173,36,47}
	\definecolor{undershirt}{rgb}{0.9,0.9,0.9}
	\definecolor{hair}{rgb}{0,0,0}
}

\newcommand{\tikzpeople@dave@definestyles}{
	\if@tikzpeople@saturated
		\tikzset{
			tie/.style={color=\tikzpeople@tie,top color=\tikzpeople@tie!70, bottom color=\tikzpeople@tie,shading angle=45}
		}
	\else
		\tikzset{
			tie/.style={color=\tikzpeople@tie!80,top color=\tikzpeople@tie!40, bottom color=\tikzpeople@tie!80,shading angle=45}
		}
	\fi
}

\newcommand{\tikzpeople@dave@painthair}{
	\if@tikzpeople@female
		\draw[hair,shading angle=-45]
			(10:3.1pt) arc (10:175:3.1pt) to[out=265,in=170,looseness=1] (250:4pt)  
			to [out=120,in=150,out looseness=1.5]	(-.5pt,.5pt) to [out=330,in=200] 
			(10:3.1pt) -- cycle;
	\else
		\draw[hair,line join=bevel]
			(20:3.1pt) arc (20:190:3.1pt) to[out=283,in=210,looseness=.5] 
			(220:3pt) arc (300:405:.1pt) to[out=120,in=110,out looseness=4,in looseness=2] 
			(-1.7pt,-.7pt) -- (-1.5pt,-.7pt) to [out=90,in=160,looseness=1]
			(-.5pt,1.2pt) to [out=340,in=200,out looseness=1.5,in looseness=.2] 
			(30:2.5pt) to [out=20,in=90,looseness=1] 
			(355:3pt) to [out=80,in=290,looseness=1] (20:3.1pt);
	\fi
}

\newcommand{\tikzpeople@dave@paintundershirt}{
	\begin{scope}
		\clip 
			(-1.9pt,-1pt) to[out=290,in=130,looseness=.75] (2pt,-7.8pt) 
			to[out=80,in=280,looseness=.75] (1.9pt,-1pt);
		\draw[undershirt]
			(-1.9pt,-1pt) to[out=290,in=130,looseness=.75] (2pt,-7.8pt) 
			to[out=80,in=280,looseness=.75] (1.9pt,-1pt);
		\if@tikzpeople@female
			\draw[skin]
				(250:2.9pt) to[out=300,in=280,looseness=2] (310:2.8pt) -- cycle;
			\path[postaction={decorate},decoration={
				markings,
				mark=between positions 0.04 and 1 step 0.04 with {\pgftransformscale{\scalingfactor}
				\fill[tie] (0pt,0pt) circle (.1pt);}
			}]
			(245:2.9pt) to[out=300,in=270,looseness=3] (311:3pt);
		\else
			\draw[tie]
				(270:3pt) -- ++(.7pt,-.1pt) -- ++(.05pt,-.3pt) to[out=275,in=95] 
				++(-.1pt,-.8pt) -- ++(1pt,-4pt) -- ++(.9pt,.25pt) -- ++(-1pt,3.8pt) 
				to[in=280,out=95] ++(-.4pt,.9pt) -- ++(-.1pt,.25pt) -- (295:3pt);
			\draw[tie]
				(270:3pt) ++(.7pt,-.1pt) to[out=30,in=175] ++(.35pt,.1pt) 
				to[out=300,in=90] ++(.1pt,-.35pt) to[out=210,in=350] ++(-.4pt,-.1pt) 
				to[out=110,in=270] ++(-0.05pt,.35pt)--cycle;
		\fi
	\end{scope}
	\begin{scope}
		\clip 
			(-4pt,-8pt) .. controls (-2pt,-10pt) and (3pt,-9pt) .. 
			( 5pt,-7pt) .. controls ( 5pt,  0pt) and (-5pt,0pt) ..
			(-4pt,-8pt);
		\if@tikzpeople@mirrored
			\path[postaction={decorate},decoration={
				markings,
				mark=between positions 0.11 and .54 step 0.02 with {\pgftransformscale{\scalingfactor}
				\draw[shirt] (0pt,0pt) -- (0pt,.3pt) arc (360:180:.15pt) -- (-.3pt,0pt);},
				mark=between positions 0.54 and .91 step 0.02 with {\pgftransformscale{\scalingfactor}
				\draw[shirt] (0pt,0pt) -- (0pt,.3pt) arc (180:360:.15pt) -- (.3pt,0pt);}
				}]
				(-1.9pt,-1pt) to[out=290,in=130,looseness=.75] (2pt,-7.8pt) 
				to[out=80,in=280,looseness=.75] (1.9pt,-1pt);
		\else
			\path[postaction={decorate},decoration={
				markings,
				mark=between positions 0.11 and .54 step 0.02 with {\pgftransformscale{\scalingfactor}
				\draw[shirt] (0pt,0pt) -- (0pt,-.3pt) arc (0:180:.15pt) -- (-.3pt,0pt);},
				mark=between positions 0.54 and .91 step 0.02 with {\pgftransformscale{\scalingfactor}
				\draw[shirt] (0pt,0pt) -- (0pt,-.3pt) arc (180:0:.15pt) -- (.3pt,0pt);}
				}]
				(-1.9pt,-1pt) to[out=290,in=130,looseness=.75] (2pt,-7.8pt) 
				to[out=80,in=280,looseness=.75] (1.9pt,-1pt);
		\fi
	\end{scope}
}

\newcommand{\tikzpeople@dave@colors}{
	shirt/340/{1/-.9}, hair/160/{-.8/1}, skin/20/{.4/.6},  tie/360/{.2/-.25}, 
	undershirt/200/{-.1/-.2}%
}
