2

Hey i have the follwoing code in my document:

\begin{tikzpicture}
  \shade[inner color=blue,outer color=white] (3,0) circle (1);
  \draw[fill=white] (3,0) circle [radius=0.7];

  \shade[inner color=blue,outer color=white] (4.8,0) circle (1);
  \draw[fill=white] (4.8,0) circle [radius=0.7];
\end{tikzpicture}

As a result i get:

overlap

How to make the overlapping shadows from circles look more natural?

RCV
  • 23

1 Answers1

3

I'd use fadings instead of shadings for that.

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{fadings}
\tikzfading[name=fade out,
inner color=transparent!0,
outer color=transparent!100]
\begin{document}
\begin{tikzpicture}
  \fill [blue,path fading=fade out]  (3,0) circle (1);
  \draw[fill=white] (3,0) circle [radius=0.7];
  \fill [blue,path fading=fade out] (4.8,0) circle (1);
  \draw[fill=white] (4.8,0) circle [radius=0.7];
\end{tikzpicture}
\end{document}

enter image description here

EDIT: It might be advantageous to construct the ring in a slightly different fashion that avoids drawing a white disk.

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{fadings}
\tikzfading[name=fade out,
inner color=transparent!0,
outer color=transparent!100]
\begin{document}
\begin{tikzpicture}
  \fill [blue,path fading=fade out]  (4,0) arc(0:360:1) -- (3.7,0) arc(360:0:0.7);
  \fill [blue,path fading=fade out]  (5.8,0) arc(0:360:1) -- (5.5,0) arc(360:0:0.7);
\end{tikzpicture}
\end{document}