Look at the two blue coloured rules with a colour gradient. This is what I'm looking for. Thank You.
[Tex/LaTex] How to draw a horizontal rule with a colour gradient
gradient
Related Solutions
The "easiest" way is to create a \pscustom
path containing the entire tower+pipes structure and fill it using pst-slpe
's slope
fill.
Below I only show a portion of the custom path, leaving out some of the pipes. However, the procedure would be the same. Also, the fill is actually solid red, with a fading applied at a 90 degree angle:
\documentclass[
a4paper,
12pt
]{article}
\usepackage[utf8]{inputenc}
\usepackage[
hmargin=2.4cm,
vmargin=3cm
]{geometry}
\usepackage{rotating}
\usepackage{pstricks-add,pst-slpe}
\newcommand*\forskel{350 140 div }
\newcommand*\udtag[2]{\rput(!10 249 140 div #1 \forskel mul add){\small #2}}
\newcommand*\pil[1]{ \rput(!11.5 249 140 div #1 \forskel mul add){\small $\rightarrow$}}
\newcommand*\destillering[1]{%
% Ventiler og udtag.
\psline(!4 2.8 #1 \forskel mul add)%
(!4 1.8 #1 \forskel mul add)%
(!4 2.3 #1 \forskel mul add)%
(!5.3 2.3 #1 \forskel mul add)%
(!5.3 2.65 #1 \forskel mul add)
\psline(!5.15 2.5 #1 \forskel mul add)%
(!5.15 2.8 #1 \forskel mul add)%
(!5.95 2.8 #1 \forskel mul add)%
(!5.95 2.5 #1 \forskel mul add)
\psline(!5.8 2.65 #1 \forskel mul add)%
(!5.8 2.3 #1 \forskel mul add)%
(!6.3 2.3 #1 \forskel mul add)%
(!6.3 2.65 #1 \forskel mul add)
\psline(!6.15 2.5 #1 \forskel mul add)%
(!6.15 2.8 #1 \forskel mul add)%
(!6.95 2.8 #1 \forskel mul add)%
(!6.95 2.5 #1 \forskel mul add)
\psline(!6.8 2.65 #1 \forskel mul add)%
(!6.8 2.3 #1 \forskel mul add)%
(!7.4 2.3 #1 \forskel mul add)
\psline(! 8.5 284 140 div #1 \forskel mul add)%
(! 8.5 214 140 div #1 1 add \forskel mul add)
\psarc(! 1144 140 div 2.3 #1 \forskel mul add){0.27142857}{180}{270}
\psarc(! 1144 140 div 2.3 #1 \forskel mul add){0.77142857}{180}{270}
\psline(! 7.9 2.3 #1 \forskel mul add)%
(! 8.5 2.3 #1 \forskel mul add)
\psline(!1144 140 div 284 140 div #1 \forskel mul add)%
(! 12 284 140 div #1 \forskel mul add)
\psline(! 12 214 140 div #1 \forskel mul add)%
(!2861 350 div 214 140 div #1 \forskel mul add)
% `Mellemventiler'.
\psline(!3.5 470 140 div #1 \forskel mul add)%
(!5.3 470 140 div #1 \forskel mul add)%
(!5.3 519 140 div #1 \forskel mul add)
\psline(!5.15 498 140 div #1 \forskel mul add)%
(!5.15 540 140 div #1 \forskel mul add)%
(!5.95 540 140 div #1 \forskel mul add)%
(!5.95 498 140 div #1 \forskel mul add)
\psline(!5.8 519 140 div #1 \forskel mul add)%
(!5.8 470 140 div #1 \forskel mul add)%
(!6.3 470 140 div #1 \forskel mul add)%
(!6.3 519 140 div #1 \forskel mul add)
\psline(!6.15 498 140 div #1 \forskel mul add)%
(!6.15 540 140 div #1 \forskel mul add)%
(!6.95 540 140 div #1 \forskel mul add)%
(!6.95 498 140 div #1 \forskel mul add)
\psline(!6.8 519 140 div #1 \forskel mul add)%
(!6.8 470 140 div #1 \forskel mul add)%
(!8.1 470 140 div #1 \forskel mul add)%
(!8.1 392 140 div #1 \forskel mul add)%
}
\pagestyle{empty}
\begin{document}
\vfill
\begin{figure}[htbp]
\centering
\psset{unit=1cm}
\begin{pspicture}(-1.02,0.3)(12,17)
% Opvarmningsovn.
%\psgrid
\psframe[linestyle=none,slopeangle=90,slopesteps=50,
fillstyle=slope,slopebegin=red,slopeend=yellow
](0.7,2)(3.3,5)% Ovn
\pscustom[linestyle=none,slopeangle=90,slopesteps=200,
fillstyle=slope,slopebegin=red,slopeend=yellow
]{
\psline(12,0.25)(6.5,0.25)
\psarcn(6.5,1){0.75}{270}{180}
\psline(5.8,1)(3.5,1)(3.5,2.4)(1.7,2.4)
\psarcn(1.7,3.1){0.7}{-90}{90}
\psline(1.7,3.8)(2.3,3.8)
\psarc(2.3,4){0.2}{-90}{90}
\psline(2.3,4.2)(-0.8,4.2)(-0.8,4.7)(2.3,4.7)
\psarcn(2.3,4){0.7}{90}{-90}
\psline(2.3,3.3)(1.7,3.3)
\psarc(1.7,3.1){0.2}{90}{-90}
\psline(1.7,2.9)(3.5,2.9)(3.5,16.3)(8.5,16.3)
(8.5,12)(12,12)(12,11.5)(8.5,11.5)% Nafta
(8.5,9.5)(12,9.5)(12,9)(8.5,9)% Petroleum
(8.5,7)(12,7)(12,6.5)(8.5,6.5)% Dieselolie
(8.5,4.5)(12,4.5)(12,4)(8.5,4)% Smoreolie
(8.5,2)(12,2)(12,1.5)(8.5,1.5)% Braendselolie
(8.5,1)(6.3,1)
\psarc(6.5,1){0.25}{180}{270}
\psline(6.5,0.75)(12,0.75)(12,0.25)
}
\psline(0.7,4.7)(0.7,5)(3.3,5)(3.3,2.9)
\psline(3.3,2.4)(3.3,2)(0.7,2)(0.7,4.2)
\psline(-0.8,4.7)(2.3,4.7)
\psline(-0.8,4.2)(2.3,4.2)
\psarc(2.3,4){0.2}{270}{90}
\psarc(2.3,4){0.7}{270}{90}
\psline(2.3,3.8)(1.7,3.8)
\psline(2.3,3.3)(1.7,3.3)
\psarc(1.7,3.1){0.2}{90}{270}
\psarc(1.7,3.1){0.7}{90}{270}
\psline(1.7,2.9)(3.5,2.9)
\psline(1.7,2.4)(3.5,2.4)
\rput(2,1.75){\small Ovn}
\rput(1.15,4.45){\small `Kold' råolie}
\rput(-0.4,4.45){\small $\rightarrow$}
% Tårnets indre samt udtag.
\multido{\i=0+1}{5}{%
\destillering{\i}%
\pil{\i}%
}
\pil{6}
\udtag{0}{Brændselsolie}
\udtag{1}{Smøreolie}
\udtag{2}{Dieselolie}
\udtag{3}{Petroleum}
\udtag{4}{Nafta}
\udtag{6}{Gasser}
% Tårnets ydre.
\psline( 3.5, 2.9)%
(! 3.5 179 140 div 6 \forskel mul add)%
(! 5.75 179 140 div 6 \forskel mul add)
\psarc(! 6.5 179 140 div 6 \forskel mul add){0.25}{90}{180}
\psline(! 6.5 214 140 div 6 \forskel mul add)%
(!12 214 140 div 6 \forskel mul add)
\psarc(! 6.5 179 140 div 6 \forskel mul add){0.75}{90}{180}
\psline(! 6.5 284 140 div 6 \forskel mul add)%
(!12 284 140 div 6 \forskel mul add)
\psline(! 6.25 179 140 div 6 \forskel mul add)%
(! 8.5 179 140 div 6 \forskel mul add)%
(! 8.5 284 140 div 5 \forskel mul add)%
% (!12 284 140 div 5 \forskel mul add)
% \psline(! 8.5 214 140 div 5 \forskel mul add)%
% (!12 214 140 div 5 \forskel mul add)
\psline(!8.5 284 140 div 5 \forskel mul add)%
(!8.5 214 140 div 5 \forskel mul add)
\psarc(6.5,1){0.25}{180}{270}
\psline(6.5,0.75)(12,0.75)
\psarc(6.5,1){0.75}{180}{270}
\psline(6.5,0.25)(12,0.25)
\psline(!8.5 214 140 div)(8.5,1)(6.25,1)
\rput(9,0.5){\small Destillationsrester}
\rput(11.5,0.5){\small $\rightarrow$}
\psline(5.75,1)(3.5,1)(3.5,2.4)
\end{pspicture}
\end{figure}
\vfill
\end{document}
You draw the fill first, and then overlay the rest of the construction as-is. The alignment along the side tubes are not 100% on, but that's because I don't fully understand where they're drawn within the mix of coordinates.
I've increased the number of steps used the define the slope colours.
Here is a solution. It's rather inelegant as it involves vertical re-positioning of separate boxes---one for the fade, and a separate for the frametitle. The right hand side of the fade is somewhat sharper than I'd like, but here goes the relevant code addition:
\usepackage{tikz}
\usetikzlibrary{fadings}%To set up the fade parameters
\begin{tikzfadingfrompicture}[name=fade right]
\shade[left color=transparent!15,
right color=transparent!100] (0,0) rectangle (2,2);
\end{tikzfadingfrompicture}
\setbeamertemplate{headline}
{
\hbox{%For the fade box---this has to come first otherwise the title won't appear ``on top'' of the faded box
\tikz\fill[scale=1.5,path fading= fade right, mypurple] (0,0) rectangle (.45\paperwidth,0.5);
}%
\vspace{-3.5em}
\hbox{%For the frame title
\pgfsetfillopacity{0}\begin{beamercolorbox}[wd=\paperwidth,ht=5.5ex,dp=3ex,left]{frame title}%
\usebeamerfont{frame title}\pgfsetfillopacity{1}\hspace{1em}{\large\insertframetitle}
\end{beamercolorbox}}%
}
Best Answer
You can control the distance between the gradients and text changing the values
1em
for example. Also, the height for rectangle could be changed1.5em
.