Skip to content

Commit

Permalink
Merge pull request #224 from EagleoutIce/222-allow-to-change-color-of…
Browse files Browse the repository at this point in the history
…-spear

allow to set color of spear tip
  • Loading branch information
EagleoutIce authored Dec 22, 2022
2 parents 8ef7de4 + 13e683e commit e888213
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
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

0 comments on commit e888213

Please sign in to comment.