Stack Exchange Network

Stack Exchange network consists of 175 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
6,837
reputation
2
19
51

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}
75
answers
46
questions
~52k
people reached
  • Member for 2 years, 1 month
  • 314 profile views
  • Last seen 2 hours ago

Top Tags (114)

Score 413
Posts 53
Posts % 44
Score 107
Posts 8
Score 81
Posts 8
Score 44
Posts 7
Score 17
Posts 5
Score 14
Posts 11

Top Posts (121) All Questions Answers | Votes Newest

View all questions and answers

Badges (72)

Gold

2

Rarest

Silver

19

Rarest

Bronze

51

Rarest