summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tikzlings/tikzlings-hippos.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/tikzlings/tikzlings-hippos.sty')
-rw-r--r--Master/texmf-dist/tex/latex/tikzlings/tikzlings-hippos.sty40
1 files changed, 32 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/latex/tikzlings/tikzlings-hippos.sty b/Master/texmf-dist/tex/latex/tikzlings/tikzlings-hippos.sty
index f6e508493ce..504dc2eea27 100644
--- a/Master/texmf-dist/tex/latex/tikzlings/tikzlings-hippos.sty
+++ b/Master/texmf-dist/tex/latex/tikzlings/tikzlings-hippos.sty
@@ -12,7 +12,7 @@
% See http://www.latex-project.org/lppl.txt
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\ProvidesPackage{tikzlings-hippos}[2020/12/04 version v0.4 Drawing hippos in TikZ]
+\ProvidesPackage{tikzlings-hippos}[2021/03/17 version v0.5 Drawing hippos in TikZ]
\RequirePackage{tikz}
\RequirePackage{tikzlings-addons}
@@ -30,6 +30,7 @@
\newif\ifhippo@threeD
\newif\ifhippo@back
+\newif\ifhippo@contour
\tikzset{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -46,6 +47,10 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
body/.code = \def\hippo@body{#1},
body = gray,
+ eye/.code = \def\hippo@eye{#1},
+ eye = white,
+ pupil/.code = \def\hippo@pupil{#1},
+ pupil = black,
toes/.code = \def\hippo@toes{#1},
toes = \hippo@body!55!white,
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -55,6 +60,10 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3D/.code = \hippo@threeDtrue,
back/.code = \hippo@backtrue,
+ contour/.code = \hippo@contourtrue
+ \def\hippo@contour{#1},
+ contour/.default = black,
+ outline/.forward to = /hippo/contour,
}
\def\hippo@draw{%
@@ -78,14 +87,18 @@
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% switch between 2D and 3D, from
+% switch between 2D, 3D and contours, from
% https://chat.stackexchange.com/transcript/message/45991801#45991801
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifhippo@threeD
\def\hippo@part@draw[##1]{\shade[ball color=##1]}
\else
- \def\hippo@part@draw[##1]{\fill[##1]}
+ \ifhippo@contour
+ \def\hippo@part@draw[##1]{\draw[##1,\hippo@contour,fill=white,line width=\scalingfactor*0.4pt]}
+ \else
+ \def\hippo@part@draw[##1]{\fill[##1]}
+ \fi
\fi
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -136,10 +149,17 @@
\ifhippo@back\else
%
% Eyes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\fill[white] (-0.11, 1.83) ellipse[x radius=0.08, y radius=0.12];
-\fill[white] (0.11, 1.83) ellipse[x radius=0.08, y radius=0.12];
-\fill[black] (-0.105, 1.78) ellipse[x radius=0.04, y radius=0.07];
-\fill[black] (0.105, 1.78) ellipse[x radius=0.04, y radius=0.07];
+\ifhippo@contour
+ \hippo@part@draw[\hippo@eye] (-0.11, 1.83) ellipse[x radius=0.08, y radius=0.12];
+ \hippo@part@draw[\hippo@eye] (0.11, 1.83) ellipse[x radius=0.08, y radius=0.12];
+ \hippo@part@draw[\hippo@pupil] (-0.105, 1.78) ellipse[x radius=0.04, y radius=0.07];
+ \hippo@part@draw[\hippo@pupil] (0.105, 1.78) ellipse[x radius=0.04, y radius=0.07];
+\else
+ \fill[\hippo@eye] (-0.11, 1.83) ellipse[x radius=0.08, y radius=0.12];
+ \fill[\hippo@eye] (0.11, 1.83) ellipse[x radius=0.08, y radius=0.12];
+ \fill[\hippo@pupil] (-0.105, 1.78) ellipse[x radius=0.04, y radius=0.07];
+ \fill[\hippo@pupil] (0.105, 1.78) ellipse[x radius=0.04, y radius=0.07];
+\fi
%
% Nose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\hippo@part@draw[\hippo@body!80!white] (0, 1.55) ellipse[x radius=0.42, y radius=0.2];
@@ -150,7 +170,11 @@
\ifhippo@threeD
\draw[black,line width=\scalingfactor*0.4pt] (0.125, 1.5) arc [start angle=-50, end angle=-130, radius=0.2] ;
\else
- \draw[\hippo@body!70!black,line width=\scalingfactor*0.4pt] (0.125, 1.5) arc [start angle=-50, end angle=-130, radius=0.2];
+ \ifhippo@contour
+ \draw[\hippo@contour,line width=\scalingfactor*0.4pt] (0.125, 1.5) arc [start angle=-50, end angle=-130, radius=0.2];
+ \else
+ \draw[\hippo@body!70!black,line width=\scalingfactor*0.4pt] (0.125, 1.5) arc [start angle=-50, end angle=-130, radius=0.2];
+ \fi
\fi
%
% Feet %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%