summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/tikzlings/tikzlings-bears.sty
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/pgf/contrib/tikzlings/tikzlings-bears.sty')
-rw-r--r--graphics/pgf/contrib/tikzlings/tikzlings-bears.sty27
1 files changed, 21 insertions, 6 deletions
diff --git a/graphics/pgf/contrib/tikzlings/tikzlings-bears.sty b/graphics/pgf/contrib/tikzlings/tikzlings-bears.sty
index a02985ca91..63d6a283e5 100644
--- a/graphics/pgf/contrib/tikzlings/tikzlings-bears.sty
+++ b/graphics/pgf/contrib/tikzlings/tikzlings-bears.sty
@@ -12,7 +12,7 @@
% See http://www.latex-project.org/lppl.txt
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\ProvidesPackage{tikzlings-bears}[2020/12/04 version v0.4 Draw teddy bears in TikZ]
+\ProvidesPackage{tikzlings-bears}[2021/03/17 version v0.5 Draw teddy bears in TikZ]
\RequirePackage{tikz}
\RequirePackage{tikzlings-addons}
@@ -30,6 +30,7 @@
\newif\ifbear@threeD
\newif\ifbear@back
+\newif\ifbear@contour
\tikzset{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -46,6 +47,8 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
body/.code = \def\bear@body{#1},
body = brown,
+ eye/.code = \def\bear@eye{#1},
+ eye = \bear@body!30!black,
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% options
@@ -53,6 +56,10 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3D/.code = \bear@threeDtrue,
back/.code = \bear@backtrue,
+ contour/.code = \bear@contourtrue
+ \def\bear@contour{#1},
+ contour/.default = black,
+ outline/.forward to = /bear/contour,
}
\def\bear@draw{%
@@ -76,14 +83,18 @@
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% switch between 2D and 3D, from
+% switch between 2D, 3D and contours, from
% https://chat.stackexchange.com/transcript/message/45991801#45991801
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifbear@threeD
\def\bear@part@draw[##1]{\shade[ball color=##1]}
\else
- \def\bear@part@draw[##1]{\fill[##1]}
+ \ifbear@contour
+ \def\bear@part@draw[##1]{\draw[##1,\bear@contour,fill=white,line width=\scalingfactor*0.4pt]}
+ \else
+ \def\bear@part@draw[##1]{\fill[##1]}
+ \fi
\fi
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -143,11 +154,15 @@
\bear@part@draw[\bear@body!70!white!80!red] (0, 1.5) ellipse[x radius=0.15, y radius=0.08];
%
% Eyes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\bear@part@draw[\bear@body!30!black] (-0.155, 1.7) circle[radius=0.05];
-\bear@part@draw[\bear@body!30!black] (0.155, 1.7) circle[radius=0.05];
+\bear@part@draw[\bear@eye] (-0.155, 1.7) circle[radius=0.05];
+\bear@part@draw[\bear@eye] (0.155, 1.7) circle[radius=0.05];
%
% Mouth %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\draw[\bear@body!30!black,line width=\scalingfactor*0.4pt] (0.145, 1.38) arc [start angle=-20, end angle=-160, radius=0.16];
+\ifbear@contour
+ \draw[\bear@contour,line width=\scalingfactor*0.4pt] (0.145, 1.38) arc [start angle=-20, end angle=-160, radius=0.16];
+\else
+ \draw[\bear@body!30!black,line width=\scalingfactor*0.4pt] (0.145, 1.38) arc [start angle=-20, end angle=-160, radius=0.16];
+\fi
%
\fi
%