Skip to content

Commit

Permalink
Merge pull request #241 from EagleoutIce/different-mixings
Browse files Browse the repository at this point in the history
Different mixings
  • Loading branch information
EagleoutIce authored Apr 13, 2023
2 parents c953c68 + 2c54546 commit fb56076
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
20 changes: 14 additions & 6 deletions doc/tikzpingus-doc.tex
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ \subsection{Predefined Styles}
\begin{multicols}{2}
\begin{itemize}
\itemsep0pt
\foreach \tx/\s in {{draw everything with a line}/{:line}, {fill main penguin}/{:fill}, {draw components with transparency}/{:ghost parts}, {draw all layers with transparency}/{:ghost}, {set main \say{devil}-components}/{:devil},{flip the penguin (swaps left \& right)}/{:back},{do not draw main pingu}/{:hide},{mix the main penguin with a given color}/{:mix},{mix the main penguin completely with a given color}/{:mix-all}} {
\foreach \tx/\s in {{draw everything with a line}/{:line}, {fill main penguin}/{:fill}, {draw components with transparency}/{:ghost parts}, {draw all layers with transparency}/{:ghost}, {set main \say{devil}-components}/{:devil},{flip the penguin (swaps left \& right)}/{:back},{do not draw main pingu}/{:hide},{mix the main penguin with a given color}/{:mix},{mix the main penguin completely with a given color}/{:mix-draw},{mix everything with a given color}/{:mix-all}} {
\item \parbox[t]{.8\linewidth}{\raggedright\expandafter\dkeyref\expandafter{\s}, \tx.} \hfill
\parbox[t]{.175\linewidth}{\scalebox{.4}{%
\begin{tikzpicture}[baseline=.35\baselineskip]%
Expand Down Expand Up @@ -1395,7 +1395,7 @@ \subsection{Drawing Styles}
\endkeyexplain

\keyexplain{:pingu}{options}{}
Apply the given options to all penguin-keys:
Apply the given options to all penguin-keys (for \keyref{body}, \keyref{wings color}, \keyref{eyes color}, \keyref{bill color}, \keyref{hair color}, and \keyref{feet color}) allowing to re-use the original color:
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[:pingu={/pingu/@block/.style={fill=green}}]
Expand All @@ -1410,19 +1410,27 @@ \subsection{Drawing Styles}
\pingu[mask,tie=red,lollipop left,:mix=50!green]
\end{tikzpicture}
\end{tcblisting}
In contrast to \dkeyref{:mix-all} this changes the active colors of the penguin.
In contrast to \dkeyref{:mix-draw} this changes the active colors of the penguin.
\endkeyexplain

\keyexplain{:mix-all}{color-mix}{50!white}
\keyexplain{:mix-draw}{color-mix}{50!white}
Mix the main penguin with given colors, but leave all extras intact. This can be used (for example) to gray-out the penguin:
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[mask,tie=red,:mix-all=50!green]
\pingu[mask,tie=red,:mix-draw=50!green]
\end{tikzpicture}
\end{tcblisting}
In contrast to \dkeyref{:mix} this changes the drawing options.
In contrast to \dkeyref{:mix} this changes the drawing options (using \keyref{:pingu}).
\endkeyexplain

\keyexplain{:mix-all}{color-mix}{50!white}
Mix everything of the penguin with given colors, including all extras intact. This can be used (for example) to gray-out the penguin:
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[mask,tie=red,:mix-all=50!green]
\end{tikzpicture}
\end{tcblisting}
\endkeyexplain

\def\cursub{}
\subsection{Extras}
Expand Down
4 changes: 3 additions & 1 deletion tex/tikzpingus.sty
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,9 @@
:fill/.style = {/pingu/body=#1,/pingu/body front=#1,/pingu/feet color=#1, /pingu/bill color=#1, /pingu/eyes color=#1, /pingu/eyes second color=#1},
:fill/.default = pingu@main,
:pingu/.style = {/pingu/@body/.style={#1},/pingu/@wings/.style={#1},/pingu/@eyes/.style={#1},/pingu/@bill/.style={#1},/pingu/@hair/.style={#1},/pingu/@feet/.style={#1}},
:mix-all/.style = {:pingu={/pingu/@block/.append style={/pingu/@pingu@all={####1!#1}, fill={####1!#1}}}},
:mix-draw/.style = {:pingu={/pingu/@block/.append style={/pingu/@pingu@all={####1!#1}, fill={####1!#1}}}},
:mix-draw/.default = 50!white,
:mix-all/.style = {/pingu/@block/.append style={/pingu/@pingu@all={##1!#1}, fill={##1!#1}},/pingu/@draw/.append style={/pingu/@pingu@all={##1!#1}, draw={##1!#1}}},
:mix-all/.default = 50!white,
:mix/.style = {
/pingu/@body/.code={\@pingu@color@mixwith\pingu@color@body@main{#1}\@pingu@color@mixwith\pingu@color@body@head{#1}},
Expand Down

0 comments on commit fb56076

Please sign in to comment.