From 88a50f3c00db61cb7bd2a9070181383cc6e8166a Mon Sep 17 00:00:00 2001 From: Florian Sihler Date: Wed, 27 Jul 2022 15:52:51 +0200 Subject: [PATCH] fill style --- documentation.tex | 12 ++++++++++-- tikzpingus.sty | 6 ++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/documentation.tex b/documentation.tex index 8aa429d..dd3acd7 100644 --- a/documentation.tex +++ b/documentation.tex @@ -92,7 +92,6 @@ language={[LaTeX]TeX}, moreemph={tikzpicture}, alsoletter={.-!:0123456789},%disable number - % moreemph=[4]{:line,:ghost,parts,:devil,:back,:hide}, deletetexcs={begin,end}, % -> lift 3 moretexcs=[2]{pingu,duck,node,pingudefaults,pingudefaultsappend,pinguloadlibrary,pinguloadlibraries}, moretexcs=[3]{begin,end}, @@ -480,7 +479,7 @@ \subsection{Predefined Styles} \begin{multicols}{2} \begin{itemize} \itemsep0pt - \foreach \tx/\s in {{draw everything with a line}/{:line}, {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}} { + \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}} { \item \parbox[t]{.8\linewidth}{\raggedright\texttt{\s}, \tx.} \hfill \parbox[t]{.175\linewidth}{\scalebox{.4}{% \begin{tikzpicture}[baseline=.35\baselineskip]% @@ -1017,6 +1016,15 @@ \subsection{Drawing Styles} \end{tcblisting} \endkeyexplain +\keyexplain{:fill}{}{} + Makes the whole penguin in one solid color (basically a shortcut for setting all main penguin colors to the same): +\begin{tcblisting}{@} +\begin{tikzpicture} + \pingu[:fill] +\end{tikzpicture} +\end{tcblisting} +\endkeyexplain + \keyexplain{:ghost parts}{opacity}{.5} Set the opacity of each penguin component individually. At the moment, this excludes some glow calculations. diff --git a/tikzpingus.sty b/tikzpingus.sty index c38225d..5302d8d 100644 --- a/tikzpingus.sty +++ b/tikzpingus.sty @@ -259,12 +259,14 @@ \newif\if@pingu@do@back@ \pgfqkeys{/pingu}{ :line/.style = {/pingu/@block/.append style={fill=none,draw=##1!80!black,shade=none,path fading=none}}, + :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, :ghost parts/.style = {/pingu/@pingu@all/.append style={opacity={#1}}}, :ghost parts/.default = {.5}, :ghost/.style = {/pingu/@pingu/.append style={opacity=#1,transparency group}}, :ghost/.default = {.5}, - :ghost glow/.style = {/pingu/@pingu/.append style={opacity=#1,transparency group},/pingu/@block/.append style={/pingu/@glow}}, - :ghost glow/.default = {.5}, + :ghost glow/.style = {/pingu/@pingu/.append style={opacity=#1,transparency group},/pingu/@block/.append style={/pingu/@glow}}, + :ghost glow/.default = {.5}, :devil/.style = {/pingu/devil horns=#1,/pingu/eyes devil=#1}, :devil/.default = pingu@purple, :hide/.style = {/pingu/body type=none,/pingu/hair=\@pingu@none,/pingu/feet=none,/pingu/wings=none,/pingu/bill=none,/pingu/eyes=none},