# TikZ shading: Captain America’s Shield

In this article, we will learn how to add shading to our illustrations in LaTeX using TikZ package. This will be amazing, we will have fun by drawing Captain America’s shield (fictional character appearing in American comic books published by Marvel Comics)

## 1. Define custom colors in LaTeX

The shield that we would like to draw is shown below. Mainly we have four circles and a star shape treated with different shades. We distinguish two colors:

• Red: RGB(135,22,20)
• Blue: RGB(44,48,128)
There are many methods to define colors in LaTeX and as we have RGB combination we can use the following command:
\definecolor{metallicRed}{RGB}{135,22,20}
\definecolor{metallicBlue}{RGB}{44,88,128}

For more details, check this article: How to define custom colors in LaTeX

To draw a shaded circle, we use \shade command where we define the circle center and its radius. For a gradient color,  we have to define the left color, right color and the middle color. Also we need to define the shading angle, which defines the orientation of the gradient.

Check the next code to see how the \shade command works.

\documentclass{standalone}

\usepackage{tikz}
\definecolor{metallicRed}{RGB}{135,22,20}
\definecolor{metallicBlue}{RGB}{44,88,128}

\begin{document}

\begin{tikzpicture}

left color = metallicRed,
right color = metallicRed,
middle color = white,
] (0,0) circle (2cm);

\end{tikzpicture}

\end{document}


Compiling the previous code, we get the illustration shown in Figure a. Now, we will repeat the process and draw smaller concentric circles with different gradient colors as follows:

% circle 1.6cm
left color = lightgray,
right color = lightgray,
middle color = white,
] (0,0) circle (1.6cm);

% circle 1.2cm
left color = metallicRed,
right color = metallicRed,
middle color = white,
] (0,0) circle (1.2cm);

% circle 0.8cm
left color = metallicBlue,
right color = metallicBlue,
middle color = white,
] (0,0) circle (0.8cm);


At this level, our illustration looks like Figure b and what it remains now is the star shape in the middle of the shield.

We use again the command \shade, but with the difference that now we draw a path that represents a star instead a circle. The path is a set of coordinates defined by $(x,y)$. We can draw the star using the coordinates of the vertices in polar coordinates $(\theta,r)$, check the code below and the animation to understand the idea.

% Draw shaded star
left color = lightgray,
right color = lightgray,
middle color = white,
] (18:0.8) -- (162:0.8) -- (-54:0.8) -- (90:0.8) -- (-126:0.8);
`

And we are done! So, mainly we have used \shade command with the following keys: left color, right color, middle color and shading angle