4
  1. I like to create a color change in vertical direction of the "pump Symbol" in the following example from black to blue to black again.

  2. The symbol itself should NOT be filled with color. ONLY the drawing lines.

My mini Example doesn't work. Any ideas?

Mini Example or MWE

\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{fadings} 
\tikzfading[name=fade gradient, top color=black!80,  bottom color=black!80,
middle color=blue!100]
%% Pumpe Symbol
\tikzset{
  pump/.style={
    circle,
    draw,
    thick,
    minimum size=0.5cm,
    path picture={
      \draw [thick] (path picture bounding box.north) -- 
                    (path picture bounding box.east) --
                    (path picture bounding box.south);
      },
  node contents={}
  }
}
%%%
\begin{document}
\begin{tikzpicture}
 \node at (0,0)[
  pump,
  path fading=fade gradient,
  align = left
];
\end{tikzpicture}
\end{document}

2 Answers 2

6

IMHO you need neither the shadings nor the fadings library here.

\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{calc}
%% Pumpe Symbol
\tikzset{
  pump/.style={
    circle,
    thick,
    minimum size=0.5cm,
    path picture={
      \path[top color=black!80,  bottom color=black!80,
middle color=blue!100,even odd rule] 
([xshift={-0.5pt}]path picture bounding box.north) -- 
                    (path picture bounding box.east) --
                    ([xshift={-0.5pt}]path picture bounding box.south) -- cycle                 
                    ([xshift=0.5pt,yshift={-(1+sqrt(2))*1pt}]path picture bounding box.north) -- 
                    ([xshift={-sqrt(2)*1pt}]path picture bounding box.east) --
                    ([xshift=0.5pt,yshift={(1+sqrt(2))*1pt}]path picture bounding box.south)-- cycle;
      \path[top color=black!80,  bottom color=black!80,
middle color=blue!100,even odd rule] let 
 \p1=($(path picture bounding box.north)-(path picture bounding box.center)$) 
 in (path picture bounding box.center) circle[radius=\y1]
 (path picture bounding box.center) circle[radius=\y1-1pt];                         
      },
  node contents={}
  }
}
%%%
\begin{document}
\begin{tikzpicture}
 \node at (0,0)[
  pump,
  align = left
];
\end{tikzpicture}
\end{document}

enter image description here

1
  • super, regards Klartex
    – Klartex
    Jul 30, 2019 at 18:12
1

Using shadings library instead of fadings, following code might be used.

\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{shadings} 
\pgfdeclareverticalshading{rainbow}{100bp}
    {color(0bp)=(black); 
    color(40bp)=(black);
    color(50bp)=(blue);
    color(60bp)=(black); 
    color(100bp)=(black)}


%\tikzfading[name=fade gradient, top color=black!80,  bottom color=black!80,
%middle color=blue!100]
%% Pumpe Symbol
\tikzset{
  pump/.style={
    circle,
    draw,
    thick,
    minimum size=0.5cm,
    path picture={
      \draw [shading=rainbow,thick] (path picture bounding box.north) -- 
                    (path picture bounding box.east) --
                    (path picture bounding box.south);
      },
  node contents={}
  }
}
%%%
\begin{document}
\begin{tikzpicture}
 \node at (0,0)[
  pump,
  %path fading=fade gradient,
  align = left
];
\end{tikzpicture}
\end{document} 

enter image description here

2
  • Thanks for the answer, but as described I don't need the filling of any space for the effect Only the "small" drawing lines, which shouls change the color from black to blue in the middle and again black rot the bottom.
    – Klartex
    Jul 28, 2019 at 17:03
  • But this symbol became more artistic :-)
    – user31034
    Jul 28, 2019 at 17:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .