I am copying a code obtained online to clip the intersection of two closed paths and fill it with a certain color. It does not report any warning or error but I don't see the clipping working.
\usepackage{tikz}
\usetikzlibrary{hobby}
\def\A{(-1,0) circle (1.5cm);}
\def\B{(0,0) circle (1.2cm);}
\begin{tikzpicture}[use Hobby shortcut,closed=true]
\fill[gray!50] (-3,-2) rectangle (3,2);
\begin{scope}[fill opacity=0.5]
\fill[color=blue]\A;
\fill[color=red] \B;
\draw \A;
\draw \B;
\end{scope}
\begin{scope}[fill opacity=1]
\clip \B;
\fill[color=white] \A;
\end{scope}
\end{tikzpicture}
The code will highlight the intersected part in white. But if I want to high light any part outside the blue and red but in the rectangular, will the clip be able to do that?





\fill[color=white] \A;. – Mar 06 '20 at 22:00even odd clipby LoopSpace, which can be found in this answer. What precisely do you want to highlight? – Mar 06 '20 at 22:25