# Why white transparent color becomes grey?

I'm trying to make a figure which use transparency in tikz. The figure consists in two overlapping rectangles. One which fading to the right and the other to the left. The rectangle fading to the right is pretty easy to make:

\fill[shading=axis, left color=blue, right color=white] (0, 1) rectangle (3, 3);


However, I cannot make the other rectangle as I want. I want it to be white on the left and blue on the right. It must also be transparent (having a alpha value equal to 70%). I tried multiple things such as using \tikzfading or defining an opacity level in the \fill command. Here is a [mcve]:

\documentclass{standalone}

\usepackage{tikz}

\begin{document}
%leftmost figure
\begin{tikzpicture}
left color=transparent!0,
right color=transparent!100]
right color=transparent!0,
left color=transparent!70!white]

\end{tikzpicture}

%middle figure
\begin{tikzpicture}
\fill[shading=axis, left color=blue, right color=white] (0, 1) rectangle (3, 3);
\fill[shading=axis, left color=white!70!transparent, right color=blue] (0, 0) rectangle (2, 2.5);
\end{tikzpicture}

%rightmost figure
\begin{tikzpicture}
\fill[shading=axis, left color=blue, right color=white] (0, 1) rectangle (3, 3);
\fill[shading=axis, left color=white, right color=blue, opacity=.7] (0, 0) rectangle (2, 2.5);
\end{tikzpicture}
\end{document}


which gives the following result:

While the leftmost figure has the second rectangle transparent on the left, it does not apply a white filter on the first rectangle. On the second figure this rectangle does not have any transparency property. Finally the rectangle of rightmost figure does have transparency but the white which has an opacity level equal to 0.7 turn to be grey. What I want to achieve is to draw a rectangle which has the color 255,255,255 in RGB and an alpha value around 180 on the left side. Is that possible ?

• Welcome to TeX.SE! I guess the issue is that \fill and \shade are different, see here. – user121799 Dec 13 '18 at 10:42

If you replace \fill by \shade in the middle and right figures, you get

\documentclass{standalone}

\usepackage{tikz}

\begin{document}
%leftmost figure
\begin{tikzpicture}
left color=transparent!0,
right color=transparent!100]
right color=transparent!0,
left color=transparent!70!white]

\end{tikzpicture}

%middle figure
\begin{tikzpicture}
\end{tikzpicture}

%rightmost figure
\begin{tikzpicture}

• @Missu Glad to hear! (Yes, this is a bit confusing since if you do not say fill, but just say \path TikZ will "guess" that you mean \shade, but if you say fill, it will fill in addition to shading. And unfortunately filling and shading an area are sometimes used interchangedly, so we could blame this on the language. ;-) – user121799 Dec 13 '18 at 10:57