Skip to content

Commit

Permalink
feat: add fish
Browse files Browse the repository at this point in the history
  • Loading branch information
EagleoutIce committed Feb 1, 2025
1 parent 278f8b7 commit 37e7078
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 2 deletions.
56 changes: 56 additions & 0 deletions doc/tikzpingus-doc.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4514,6 +4514,62 @@ \subsubsection{The lollipop}
\end{tcblisting}
\endsubkeyexplain

\subsubsection{The fish}

\showkeyexplain{fish left}{color}{pingu@blue!50!pingu@green!50!black!90!gray}
Enable the left fish for the penguin:
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[fish left=green]
\end{tikzpicture}
\end{tcblisting}
\endshowkeyexplain

\subkeyexplain{fish left}{fish left scales}{color}{\pingu@color@fishleft@scales}
Change the scales color of the left fish:
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[fish left, fish left scales=green]
\end{tikzpicture}
\end{tcblisting}
\endsubkeyexplain

\subkeyexplain{fish left}{fish left eye}{color}{\pingu@color@fishleft@eye}
Change the eye color of the left fish:
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[fish left, fish left eye=green]
\end{tikzpicture}
\end{tcblisting}
\endsubkeyexplain

\showkeyexplain{fish right}{color}{pingu@blue!50!pingu@green!50!black!90!gray}
Enable the right fish for the penguin:
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[fish right=green]
\end{tikzpicture}
\end{tcblisting}
\endshowkeyexplain

\subkeyexplain{fish right}{fish right scales}{color}{\pingu@color@fishright@scales}
Change the scales color of the right fish:
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[fish right, fish right scales=green]
\end{tikzpicture}
\end{tcblisting}
\endsubkeyexplain

\subkeyexplain{fish right}{fish right eye}{color}{\pingu@color@fishright@eye}
Change the eye color of the right fish:
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[fish right, fish right eye=green]
\end{tikzpicture}
\end{tcblisting}
\endsubkeyexplain

\subsubsection{The flower}

\showkeyexplain{flower left}{color}{pingu@white!80!pingu@black}
Expand Down
3 changes: 1 addition & 2 deletions examples/minimal.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
\usepackage[active, tightpage]{preview}

\PreviewBorder.5cm
\colorlet{@main}{pingu@bronze!60!lightgray!95!green!80!black!60!pingu@bronze}
\begin{document}
\begin{preview}
\parbox[c][3.5cm][c]{3.5cm}{\centering
\begin{tikzpicture}
\pingu[detective cap,magnifier right=@main,right wing shock,right wing item angle=172,left eye wink,tie=pingu@bronze,right eye vertical,magnifier right yshift=1.5mm,pants=@main,pants buttons=@main!30!pingu@black]
\pingu[fish right,eyes wink]
\end{tikzpicture}\kern9pt}%
\end{preview}
\end{document}
Expand Down
28 changes: 28 additions & 0 deletions tex/tikzpingus.sty
Original file line number Diff line number Diff line change
Expand Up @@ -2153,6 +2153,34 @@ scale=\pingu@x@pumpkinhat@scale]
\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@wing@extra{fish}{%
fish \@lr/.code = {\pingu@set@extra{fish\@lr}{true}\pingu@color{fish\@lr}{##1}},
fish \@lr/.default = pingu@blue!50!pingu@green!50!black!90!gray,
fish \@lr\space scales/.code = \pingu@color{fish\@lr @scales}{##1},
fish \@lr\space eye/.code = \pingu@color{fish\@lr @eye}{##1},
}{fish \@lr\space scales=white!90!pingu@blue!80!black, fish \@lr\space eye=pingu@white}

% #1 wing
\def\pingu@draw@wi@fish#1{%
\pingu@setup@wing{fish}{#1}%
\scope[rotate around={\@angle:(\pingu@name-wing-#1)}]
\def\fishpath{(\pingu@name-wing-#1)++(-5mm,0) to[bend left=38] ++(9mm,0) to[out=-40,in=180] ++(1.5mm,-1.5mm) to[bend left=25] ++(0,3mm) to[out=180,in=40] ++(-1.5mm,-1.5mm) to[bend left=38] cycle};
\pingu@block[draw=\csname pingu@color@fish#1@scales\endcsname, sharp corners, line join=round]{\@col} \fishpath;

\clip\fishpath;
% TODO: allow to configure
\foreach \i in {0,...,11} {
\foreach \j in {1,...,30} {
\pgfmathsetmacro\upshift{mod(\j,2)*.2mm}
\pingu@draw[very thin]{\csname pingu@color@fish#1@scales\endcsname} (\pingu@name-wing-#1)++(-3.5mm+.35mm*\j,2mm+-.4 85mm*\i+\upshift) arc (75:-90:.35mm and .25mm);
}
}
\pingu@block[rounded corners=.1mm]{\csname pingu@color@fish#1@eye\endcsname} (\pingu@name-wing-#1)++(-3.8mm,.25mm) circle[radius=.2mm];
\endscope
}


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

0 comments on commit 37e7078

Please sign in to comment.