tikz.dev / TikZpingus Manual

The TikZpingus package

Internals

C.4 General Commands

\pingu@name

Holds the name of the penguin.

\pingu@one

Do not change this dimension as it represents one milli meter as the base unit.

C.4.1 Color Management

There is not a lot of magic in the color handling of this package.

\pingu@color{⟨name⟩}{⟨color⟩}

Creates a macro \pingu@color@<name> that links to the given color:

\def\pingu@color#1#2{%
\expandafter\def\csname pingu@color@#1\endcsname{#2}%
}

I decided against the usage of \colorlet, to support \@pingu@none and dynamic redefinition of the colors.

\@pingu@none

Holds the special color to hide the drawing of specific components as described within Section 2.3 (holds the value: “!hide”). If you redefine this command, you redefine this hidden color. Hover, if done outside of the preamble, this may result in weird side effects due to expansions.

As shown in Section 2.3, this is the definition of the colors, with the helper-macro \@pingu@color@, which i created solely for me editor to highlight the colors accordingly:

\def\@pingu@color@ #1#2(#3,#4,#5){\definecolor{pingu@#1}{#2}{#3,#4,#5}}
\@pingu@color@{main}RGB(3,14,29)
\@pingu@color@{black}RGB(23,19,19)
\@pingu@color@{silver}RGB(192,192,192)
\@pingu@color@{bronze}RGB(205,127,50)
\@pingu@color@{white}RGB(248,248,248)
\@pingu@color@{yellow}RGB(252,187,21)
\@pingu@color@{lightblue}RGB(174,229,243)
\@pingu@color@{blue}RGB(48,161,247)
\@pingu@color@{green}RGB(129,204,41)
\@pingu@color@{red}RGB(217, 40, 28)
\@pingu@color@{purple}RGB(244,48,93)
\def\@pingu@none{!hide}
C.4.2 Selections

A selection is a family of options that exclude each other, like the eyes or the feet: exactly one member is active, and the key that selects it is generated from the name of the member. The code which draws the active member is stored in one macro, and it is called when the part is drawn.

\pingu@create@selection{⟨name⟩}{⟨none default⟩}

Creates a new enumeration-like structure that can be used to register a family of options (see Section C.5 for an example). The none default is used for the default member of the selection: none which is active, whenever no other key is selected by \pingu@<selection>@select. You can add keys by using \pingu@<selection>@add and execute the selection by \@pingu@drawer@<selection>@.

\pingu@<selection>@select{⟨select⟩}

Requires \pingu@create@selection.

\pingu@<selection>@add{⟨select⟩}

Requires \pingu@create@selection.

\@pingu@drawer@<selection>@

Requires \pingu@create@selection.