% !TeX root = ./testing/context_duck.tex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% The tikzducks package
% A package to bring rubber ducks into tikz
% Maintained by samcarter
%
% Project repository and bug tracker:
% https://github.com/samcarter/tikzducks
%
% Released under the LaTeX Project Public License v1.3c or later
% See http://www.latex-project.org/lppl.txt
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Code for this ConTeXt User Module kindly provided by @JairoAdelRio https://github.com/samcarter/tikzducks/pull/25
\writestatus{loading}{ConTeXt User Module / TikZDucks 2020/06/30 version v1.5 Draw rubber ducks in TikZ}
\setupcolors[state=start]
\usemodule[tikz]
\enabledirectives[colors.pgf]
\usetikzlibrary[patterns] % for the wizard hat
\usetikzlibrary[calc]
\definecolor[duck@overleafcol][x=48AC3C]
%\unprotect does not work here
\catcode`\@=11
%So \scalebox and co. works in MkIV too
\define[2]\scalebox{\scale[factor={\ctxlua{context(3*#1)}}]{#2}}
\let\tiny\tfxx
\let\pdfrandomseed\randomseed
%Duck
\def\duck{\dosingleempty\doduck}
\def\doduck[#1]{%
    \iffirstargument
        \startscope%
            \tikzset{/duck/.cd,#1}%
            \duck@draw%
        \stopscope%
    \else
        \startscope%
            \tikzset{/duck/.cd}%
            \duck@draw%
        \stopscope%
    \fi%
}
%Stripes
\def\stripes{\dosingleempty\dostripes}
\def\dostripes[#1]{
	\iffirstargument
	\tikzset{/stripes/.cd,#1}\stripes@draw
	\else
	\tikzset{/stripes/.cd}\stripes@draw
	\fi
}
\input tikzducks-generic.tex
\catcode`\@=12
\endinput
