Example: Sunset

Published 2012-01-19 | Author: Elena Botoeva

Sunset over a line of mountains

Download as: [PDF] [TEX]  •  [Open in Overleaf]

Sunset

Do you have a question regarding this example, TikZ or LaTeX in general? Just ask in the LaTeX Forum.
Oder frag auf Deutsch auf TeXwelt.de. En français: TeXnique.fr.

% Sunset
% Author: Elena Botoeva
\documentclass{article}
\usepackage[margin=0.3cm, paperwidth=10.6cm, paperheight=6.6cm]{geometry}
\usepackage{tikz}
\usetikzlibrary{fadings}
\usetikzlibrary{decorations}
\usepgflibrary{decorations.pathmorphing}

\tikzfading[name=fade out, inner color=transparent!0,
  outer color=transparent!100]

\pagestyle{empty}
\begin{document}

\begin{center}
  \begin{tikzpicture}
    
    \clip (-5,-3) rectangle (5,3);

    % the sky
    \fill[blue!10!black] (-6,1) rectangle (6,3);
    \fill[yellow] (-6,-3) rectangle (6,1);
    \fill[inner color=blue!50!,outer color=blue!10!black] (-12,-6) rectangle (9,2);

    % orange fadings
    \draw[draw=none] 
    [postaction={path fading=north,fill=orange!80!yellow,opacity=0.6}]
    (-7,-2.5) rectangle (7,-1.5);%
    \draw[draw=none] 
    [postaction={path fading=north,fill=orange,opacity=0.8}]
    (-7,-2.5) rectangle (7,-2);

    % the line of mountains
    \fill[black]
    decorate [decoration={random steps,segment length=3pt,amplitude=1pt}] %
    {(-5,-2.25) -- (-3.5,-2.25)}%
    decorate [decoration={random steps,segment length=5pt,amplitude=4pt}] %
    {-- (-2.5,-2.25) -- (-1,-2.25)}%
    decorate [decoration={random steps,segment length=3pt,amplitude=1pt}] %
    {-- (-1,-2.25) -- (5,-2.25)}%
    -- (5,-3) -- (-5,-3) -- (-5,-2.25);

    % a planet or a star
    \draw[color=white] (3.6,1) circle (0.005);
  \end{tikzpicture}  
\end{center}
\end{document}

Comments

  • #1 Isaque Dutra, April 1, 2012 at 3:01 p.m.

    Impressive use of Tikz! Very nice picture.

Adding comments is currently not enabled.