diff options
author | Karl Berry <karl@freefriends.org> | 2021-03-17 21:39:31 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-03-17 21:39:31 +0000 |
commit | 33ae88e5a364265d921e4db20d33f86d401a095f (patch) | |
tree | d2d34a5e1e9bec0d7dcf76600fac0c77585d16b7 /Master/texmf-dist/tex/latex/tikzlings/tikzlings-koalas.sty | |
parent | ea174d11ebe4836a256865f9b5c7f3b1e9b72d72 (diff) |
tikzlings (17mar21)
git-svn-id: svn://tug.org/texlive/trunk@58469 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tikzlings/tikzlings-koalas.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/tikzlings/tikzlings-koalas.sty | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/latex/tikzlings/tikzlings-koalas.sty b/Master/texmf-dist/tex/latex/tikzlings/tikzlings-koalas.sty index dca82444392..9e77fb14aed 100644 --- a/Master/texmf-dist/tex/latex/tikzlings/tikzlings-koalas.sty +++ b/Master/texmf-dist/tex/latex/tikzlings/tikzlings-koalas.sty @@ -12,7 +12,7 @@ % See http://www.latex-project.org/lppl.txt % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\ProvidesPackage{tikzlings-koalas}[2020/12/04 version v0.4 Drawing koalas in TikZ] +\ProvidesPackage{tikzlings-koalas}[2021/03/17 version v0.5 Drawing koalas in TikZ] \RequirePackage{tikz} \RequirePackage{tikzlings-addons} @@ -37,6 +37,7 @@ \newif\ifkoala@sleeping \newif\ifkoala@threeD \newif\ifkoala@back +\newif\ifkoala@contour \tikzset{ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -53,6 +54,8 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% body/.code = \def\koala@body{#1}, body = gray!75!white, + eye/.code = \def\koala@eye{#1}, + eye = black, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % options @@ -62,6 +65,10 @@ sleeping/.code = \koala@sleepingtrue, 3D/.code = \koala@threeDtrue, back/.code = \koala@backtrue, + contour/.code = \koala@contourtrue + \def\koala@contour{#1}, + contour/.default = black, + outline/.forward to = /koala/contour, } \def\koala@draw{% @@ -85,14 +92,18 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% switch between 2D and 3D, from +% switch between 2D, 3D and contours, from % https://chat.stackexchange.com/transcript/message/45991801#45991801 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifkoala@threeD \def\koala@part@draw[##1]{\shade[ball color=##1]} \else - \def\koala@part@draw[##1]{\fill[##1]} + \ifkoala@contour + \def\koala@part@draw[##1]{\draw[##1,\koala@contour,fill=white,line width=\scalingfactor*0.4pt]} + \else + \def\koala@part@draw[##1]{\fill[##1]} + \fi \fi % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -159,8 +170,8 @@ \fill[\koala@body!50!black, even odd rule] (0.3331, 1.741) .. controls (0.3331, 1.685) and (0.1737, 1.685) .. (0.1737, 1.741) .. controls (0.1737, 1.848) and (0.3331, 1.848) .. (0.3331, 1.741) -- cycle (0.328, 1.741) .. controls (0.323, 1.705) and (0.184, 1.705) .. (0.179, 1.741) .. controls (0.184, 1.843) and (0.323, 1.843) .. (0.328, 1.741) -- cycle; \fill[\koala@body!50!black, even odd rule] (-0.3331, 1.741) .. controls (-0.3331, 1.685) and (-0.1737, 1.685) .. (-0.1737, 1.741) .. controls (-0.1737, 1.848) and (-0.3331, 1.848) .. (-0.3331, 1.741) -- cycle (-0.328, 1.741) .. controls (-0.323, 1.705) and (-0.184, 1.705) .. (-0.179, 1.741) .. controls (-0.184, 1.843) and (-0.323, 1.843) .. (-0.328, 1.741) -- cycle; \else - \koala@part@draw[black] (-0.255, 1.74) circle[radius=0.08]; - \koala@part@draw[black] (0.255, 1.74) circle[radius=0.08]; + \koala@part@draw[\koala@eye] (-0.255, 1.74) circle[radius=0.08]; + \koala@part@draw[\koala@eye] (0.255, 1.74) circle[radius=0.08]; \fill[white] (-0.27, 1.76) circle[radius=0.015]; \fill[white] (0.24, 1.76) circle[radius=0.015]; \fi @@ -168,8 +179,12 @@ % Mouth %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifkoala@threeD \draw[black,line width=\scalingfactor*0.4pt] (0.115, 1.39) arc [start angle=-40, end angle=-140, radius=0.16]; -\else - \draw[\koala@body!40!black,line width=\scalingfactor*0.4pt] (0.115, 1.39) arc [start angle=-40, end angle=-140, radius=0.16]; +\else + \ifkoala@contour + \draw[\koala@contour,line width=\scalingfactor*0.4pt] (0.115, 1.39) arc [start angle=-40, end angle=-140, radius=0.16]; + \else + \draw[\koala@body!40!black,line width=\scalingfactor*0.4pt] (0.115, 1.39) arc [start angle=-40, end angle=-140, radius=0.16]; + \fi \fi % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -180,8 +195,13 @@ % % Blushed %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifkoala@blush - \fill[red,path fading=koala@blush] (-0.3, 1.52) circle[radius=0.1]; - \fill[red,path fading=koala@blush] (0.3, 1.52) circle[radius=0.1]; + \ifkoala@contour + \fill[\koala@contour,path fading=koala@blush] (-0.3, 1.52) circle[radius=0.1]; + \fill[\koala@contour,path fading=koala@blush] (0.3, 1.52) circle[radius=0.1]; + \else + \fill[red,path fading=koala@blush] (-0.3, 1.52) circle[radius=0.1]; + \fill[red,path fading=koala@blush] (0.3, 1.52) circle[radius=0.1]; + \fi \fi % \fi |