-1

Where I can find the section about color gradient in the tikz documentation? Specifically, I would like to make the gradient you see in the outermost ring of this image. Forget the rest, I can easily do it later, for the moment I am only interested in the gradient of the outermost ring

enter image description here

2 Answers 2

2

Section 69 Shading Library

enter image description here

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shadings}

\begin{document}

\begin{tikzpicture}
\draw[cyan, top color=cyan,bottom color=cyan,middle color=white] (0,0) circle[radius=50pt];
\draw[fill=gray] (0,0) circle[radius=30pt];
\end{tikzpicture}

\end{document}

enter image description here


For more advanced gradient look at Section 114.2 Declaring Shadings

Using \pgfdeclareverticalshading in this case, you can specify any amount of colors and the placement, with etc.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shadings}

\begin{document}

\pgfdeclareverticalshading{mygradient}{2cm}{color(0cm)=(blue!50!cyan); color(1.5cm)=(white); color(2.5cm)=(white); color(4cm)=(blue!50!cyan)}

\begin{tikzpicture}
\draw[cyan, shading=mygradient] (0,0) circle[radius=50pt];
\draw[fill=gray] (0,0) circle[radius=30pt];
\end{tikzpicture}

\end{document}

enter image description here

2
1
\documentclass[tikz, border=1cm]{standalone}
\begin{document}
\begin{tikzpicture}
\draw[top color=cyan!60!white, bottom color=cyan!60!white, middle color=white] (0,0) circle[radius=4cm];
\filldraw[fill=gray, ultra thick] (0,0) circle[radius=3cm];
\end{tikzpicture}
\end{document}

Ring with cyan color gradient

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .