Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
5,578 reputation
1
2
12

Milo

You may be wondering why my Identicon looks colourful? See page 687 of the PGF/TikZ manual. It's bilinear interpolation using the shadings library. Yes, I really did re-create my Identicon using TikZ :)

\documentclass[tikz]{standalone}
\usetikzlibrary{shadings}
\begin{document}
\begin{tikzpicture}

\newcommand{\fillCol}{white}
\pgfmathsetmacro{\C}{1}
\pgfmathsetmacro{\D}{\C/2}
\pgfmathsetmacro{\E}{\D/2}

\shade[upper left=red,upper right=green,
lower left=blue,lower right=yellow] (0,0) rectangle (4*\C,4*\C);

\foreach \X/\Y/\R in {0/0/0,4*\C/0/90,4*\C/4*\C/180,0/4*\C/270}{
\begin{scope}[\fillCol,xshift=\X cm,yshift=\Y cm,rotate=\R]
\fill (0,0)--++(\C,\C)--++(0,\C)--cycle (0,\C)--++(\C,\C)--++(-\C,\D)--cycle (\C,2*\C)--++(0,\C)--++(-\C,0)--cycle;
\end{scope}}

\begin{scope}[xshift=\C cm,yshift=\C cm]
\foreach \X/\Y in {0/0,0/\C,\C/\C,\C/0}{
\begin{scope}[\fillCol,even odd rule,xshift=\X cm,yshift=\Y cm]
\fill (\D,0)--++(\D,\D)--++(-\D,\D)--++(-\D,-\D)--cycle (\D,\E)--++(\E,\E)--++(-\E,\E)--++(-\E,-\E)--cycle;
\end{scope}}
\end{scope}

\end{tikzpicture}
\end{document}

Top Tags (4)

Score 118
Posts 10
Posts % 100
Score 118
Posts 10
Score 46
Posts 7
Score 46
Posts 7

Top Posts (10) All Questions Answers | Votes Newest

Badges (15)

Gold 1

Rarest

Silver 2

Rarest

Bronze 12

Rarest