Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow to set color of spear tip #224

Merged
merged 3 commits into from
Dec 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions doc/tikzpingus-doc.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5328,11 +5328,11 @@ \subsubsection{The staff}
Similar to \keyref{staff left code} but does not override but (locally) prepend to previous calls.
\endsubkeyexplain

\showkeyexplain{spear left}{}{}
Example of \keyref{staff left code app} that renders a little (currently not configurable) spear-tip:
\showkeyexplain{spear left}{color}{gray}
Example of \keyref{staff left code app} that renders a little spear-tip:
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[spear left, staff left raise=-6mm]
\pingu[spear left=cyan]
\end{tikzpicture}
\end{tcblisting}
\endshowkeyexplain
Expand Down Expand Up @@ -5387,11 +5387,11 @@ \subsubsection{The staff}
Similar to \keyref{staff right code} but does not override but (locally) prepend to previous calls.
\endsubkeyexplain

\showkeyexplain{spear right}{}{}
Example of \keyref{staff right code app} that renders a little (currently not configurable) spear-tip:
\showkeyexplain{spear right}{color}{gray}
Example of \keyref{staff right code app} that renders a little spear-tip:
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[spear right, staff right raise=-6mm]
\pingu[spear right=cyan]
\end{tikzpicture}
\end{tcblisting}
\endshowkeyexplain
Expand Down
2 changes: 1 addition & 1 deletion examples/minimal.tex
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

\begin{document}
\begin{preview}
\tikz{\pingu[cross left]}
\tikz{\pingu[spear left,spear right=cyan]}
\end{preview}
\end{document}

3 changes: 2 additions & 1 deletion tex/tikzpingus.sty
Original file line number Diff line number Diff line change
Expand Up @@ -1335,9 +1335,10 @@ coordinate[pos=\pinguanglehl] (\pingu@name-head-left);
staff \@lr\space code/.code = \expandafter\def\csname pingu@staff@\@lr @code\endcsname{##1},
spear \@lr/.style = {staff \@lr, staff \@lr\space code app={
\noexpand\pgfonlayer{background}
\fill[gray,rounded corners=1pt] ([yshift=-1.5mm]\noexpand\pingu@name-staff-\@lr-top) -- ++(1mm,1.5mm) -- ++(-1mm,4mm) -- ++(-1mm,-4mm) -- cycle;
\fill[##1,rounded corners=1pt] ([yshift=-1.5mm]\noexpand\pingu@name-staff-\@lr-top) -- ++(1mm,1.5mm) -- ++(-1mm,4mm) -- ++(-1mm,-4mm) -- cycle;
\noexpand\endpgfonlayer
}},
spear \@lr/.default=gray,
cross \@lr/.style = {staff \@lr=##1, staff \@lr\space code app={
\noexpand\pgfonlayer{foreground}
\fill[##1,rounded corners=1pt] ([yshift=-4.5mm,xshift=-4mm]\noexpand\pingu@name-staff-\@lr-top) rectangle ++(8mm,1mm);
Expand Down