18

Drawing a semi-transparent arrow should be easy enough, right?

\documentclass{article}

\usepackage{tikz}
%\usetikzlibrary{arrows} % this doesn't change the result

\pagenumbering{gobble}

\begin{document}

\begin{tikzpicture}
  \draw[-stealth,line width=12pt,opacity=0.5] (0, 0) -- (0, 2);
\end{tikzpicture}

\end{document}

However, this produces the following result:

Result of the above MWE, demonstrating an arrow with overlapping regions in the rectangle and arrowhead

Note that the arrow is darker than it should be where the rectangle and arrowhead overlap.

How can I get an arrow of this shape and size without this artifact? (Clean solutions preferred.)

wchargin
  • 3,139

1 Answers1

28

This is what the transparency group feature is for: wrap your arrow in \begin{scope}[transparency group, opacity=0.5] ... \end{scope}:

\documentclass{article}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\draw [line width=10pt, cyan] (-1,0) -- (1,2);
\begin{scope}[transparency group, opacity=0.75]
\draw[-stealth,line width=12pt, red] (0, 0) -- (0, 2);
\end{scope}
\end{tikzpicture}

\end{document}
Jake
  • 232,450