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?

2

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}
  • Thank you, i have not used tikz for a while so I forgot about it. – RCV Aug 20 '18 at 15:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.