2

Is it possible to blend a line from a start color to an end color, such as from red to blue?

Sebastiano
  • 54,118

1 Answers1

4
\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{shapes.arrows}
\begin{document}
\begin{tikzpicture}
\node [single arrow,left color=red,right color=blue,
single arrow head extend=3pt,transform shape,minimum height=2cm,anchor=west] 
at (0,0){};

\shade[left color=red,right color=blue] (0,-1) rectangle ++(2,0.25);
\end{tikzpicture}
\end{document}

enter image description here

pgfplots has the ability to add these color transitions via point meta, see e.g. this answer.

enter image description here