1

I am attempting to do a mirror/reflection effect using TikZ fadings, but the fade that I am currently able to achieve is too 'gentle' - the line fades, but all of the line remains. The line's reflection itself is in the correct position, but the intensity of the fade is not enough - I want the line to disappear quite quickly.

This is my MWE:

\documentclass[11pt,twoside]{book}

\usepackage{tikz} 
\usetikzlibrary{fadings}
\usepackage{afterpage}
\usepackage{xcolor}
\usepackage{geometry}

\geometry{
    paperwidth=17.78cm,
    paperheight=25.4cm,
    marginparsep=6.35mm,
    top=.5cm, % Top margin
    bottom=1cm, % Bottom margin
    left=2cm, % Left margin
    right=2cm, % Right margin
}

% Adds bleed
\usepackage[
width=18.0975cm,
height=26.035cm,
center,
%cam,
%cross,
%frame
]{crop}

\begin{document}
    \begin{titlepage}
        \pagecolor{orange}\afterpage{\nopagecolor}

        \begin{tikzpicture}
        \draw[overlay, white, line width=1.1mm] (-3,-.35) .. controls (-2.5,-4.5) and (5,-3.5) .. (20,.5);
        \begin{scope}[shift={(0,-6.15)},xscale=1,yscale=-1,rotate=360]
        \draw[overlay, white, line width=1.1mm,path fading=south] (-3,-.35) .. controls (-2.5,-4.5) and (5,-3.5) .. (20,.5);  % Mirror Image
        \end{scope}
        \end{tikzpicture}
    \end{titlepage}
\end{document}

Which produces this:

This is what I am currently able to achive using TikZ

And this is the desired effect that I am trying to achieve:

This is the desired effect (done in Pages)

Is it possible to achieve my desired effect using TikZ?

Thank you very much for any help in advance.

2

One can look up the definition of the original south fading in pgflibraryfadings.code.tex to find

\pgfdeclareverticalshading{pgf@lib@fade@south}{100bp}
{color(0bp)=(pgftransparent!100); color(25bp)=(pgftransparent!100);
color(75bp)=(pgftransparent!0); color(100bp)=(pgftransparent!0)}%

\pgfdeclarefading{south}{\pgfuseshading{pgf@lib@fade@south}}%

All I did was to change color(25bp)=(pgftransparent!100); to color(40bp)=(pgftransparent!100); in a fading I called South in

\documentclass[11pt,twoside]{book}

\usepackage{tikz} 
\makeatletter
\pgfdeclareverticalshading{pgf@lib@fade@South}{100bp}
{color(0bp)=(pgftransparent!100); color(40bp)=(pgftransparent!100);
 color(75bp)=(pgftransparent!0); color(100bp)=(pgftransparent!0)}%
\pgfdeclarefading{South}{\pgfuseshading{pgf@lib@fade@South}}%
\makeatother
\usetikzlibrary{fadings}
\usepackage{afterpage}
\usepackage{xcolor}
\usepackage{geometry}

\geometry{
    paperwidth=17.78cm,
    paperheight=25.4cm,
    marginparsep=6.35mm,
    top=.5cm, % Top margin
    bottom=1cm, % Bottom margin
    left=2cm, % Left margin
    right=2cm, % Right margin
}

% Adds bleed
\usepackage[
width=18.0975cm,
height=26.035cm,
center,
%cam,
%cross,
%frame
]{crop}

\begin{document}
    \begin{titlepage}
        \pagecolor{orange}\afterpage{\nopagecolor}

        \begin{tikzpicture}
        \draw[overlay, white, line width=1.1mm] (-3,-.35) .. controls (-2.5,-4.5) and (5,-3.5) .. (20,.5);
        \begin{scope}[shift={(0,-6.15)},xscale=1,yscale=-1,rotate=360]
        \draw[overlay, white, line width=1.1mm,path fading=South] 
        (-3,-.35) .. controls (-2.5,-4.5) and (5,-3.5) .. (20,.5);  % Mirror Image
        \end{scope}
        \end{tikzpicture}
    \end{titlepage}
\end{document}

enter image description here

With 50bp instead of 40bp you get

enter image description here

| improve this answer | |
  • Works perfectly, thank you! – Tomsk May 19 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.