12. Use five different colors to color the five vertices of the "pentagram" in Figure 1 (each vertex is colored with one color, and some colors may not be used), so that the two vertices on each line segment are of different colors. Then the number of different coloring methods is .
12.1020.

Convert it into a coloring problem of a disk with 5 sectors, each to be colored with one of 5 colors, such that no two adjacent sectors have the same color (as shown in Figure 4).

Let the number of ways to color a disk with $k$ sectors using 5 colors be $x_{k}$. Then, we have $x_{k}+x_{k-1}=5 \times 4^{k-1}$. Therefore,
$$
\begin{array}{l} 
x_{5}=\left(x_{5}+x_{4}\right)-\left(x_{4}+x_{3}\right)+ \\
\left(x_{3}+x_{2}\right)-x_{2} \\
=5\left(4^{4}-4^{3}+4^{2}-4\right)=1020 .
\end{array}
$$