I wanted a fading line with the same color at both the ends and a second color in the middle. Here is the crude MWE I came up with:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[baseline]
\path[left color=white,right color=black]
(0,0) rectangle (.5\textwidth,.5pt);%
\path[left color=black,right color=white]
(.5\textwidth,0) rectangle (\textwidth,.5pt);
\end{tikzpicture}
\end{document}
This leaves a tiny tiny gap in the center. (Or is it just an optical illusion I get because I know I have used two path commands?)
Is there a better way of doing it? May be, with only one path/ fill/ rectangle command?
middle colorkey? – Paul Gaborit Mar 20 '15 at 06:16middle colorwas excellent. Looked up the exact syntax intexdoc tikzand done. Will you please give that comment as an answer? I will then accept it. – deshmukh Mar 20 '15 at 07:14