# How to define the distance of color regions in radial shading using TikZ?

I am making a series of figures explaining the photolithographic process, and need to find a way to illustrate edge beads during spin coating. To show this I initially wanted to use radial shading, and create a band around the edge of my figure where the color darkens over a short distance, but I cannot seem to find out how to define the width of the inner or outer color in that shading mode. The result is that the shading I want to employ progresses gradually from the origo of the circle and terminates at the very edge.

How can I ensure that the color change starts a user definded distance from the edge?

E.g. as indicated in the dummy code (does not compile):

\begin{tikzpicture}
\draw[outer color=purple!70!black,inner color=purple!80,fading width=5pt](0,0) circle (1.5);
\end{tikzpicture}

• Do you want less levels on the gradient? for example, only seven steps from the origin to the boundary? Or do you want to finish the gradient inside the circle, not exactly at its boundary? Is it enough to do the gradient with a smaller radius? Maybe 1.45? – Sigur Nov 23 '13 at 14:15
• I want to start the gradient at a point close to the edge. So that we have a uniform color, for example the purple!80 photoresist color I have chosen, all the way to, for example, 10pt away from the edge. At that point I would like the gradient to start and then finish at the very edge. – The V Nov 23 '13 at 14:19
• So do you want to move the center of the gradient? Like a ball? \shade[ball color=red] (0,0) circle (1.5); ps: you'll need \usetikzlibrary{shadings}. – Sigur Nov 23 '13 at 14:22
• I am familiar with the shadings library and ball shading. Alas, that is not what I want. I want the center to be larger, significantly larger, and still centrosymmetric. I also want the the shading area to be uniform but thin near the edge of the circle. Consider two concentric circles, one with radius 1.5 and an inner with radius 1.4. I would want the shading to start at 1.4 and end, darkened, at 1.5. Hence, the "fuzzy edge fifteen percent" provided by the shadings library will not serve. – The V Nov 23 '13 at 14:35
• Ah, well, play around and get it working. A little quick and dirty, but putting one circle above another like so: \begin{tikzpicture} \draw[purple!70!black,fill](0,0) circle(1.5); \draw[path fading=circle with fuzzy edge 10 percent,fill=purple!80](0,0) circle(1.5); \end{tikzpicture} does the trick. – The V Nov 23 '13 at 14:41

\documentclass{article}
\usepackage{tikz}

{color(0cm)=(purple!80);
color(0.7cm)=(purple!80);
color(0.74cm)=(purple!80);
color(0.82cm)=(purple!70);
color(0.9cm)=(purple!65!black)}

\begin{document}
\begin{tikzpicture}
\end{tikzpicture}

\end{document}


One way to solve this, and I am not satisfied with the solution which appears a little "dirty" to me is by using the fuzzy edge shading provided by the shadings library.

\documentclass{minimal}
\usepackage{tikz}