# Draw the Ubuntu Logo with Tikz

Starting with Tikz, I'm trying to draw the Ubuntu Logo.

However, I'm stuck at the begining, since I don't know how to draw the three gaps on the logo. My idea is to draw 3 rectangles and fill them in white. But I didn't manage to draw these rectangles.

For the moment, this is my code :

\begin{tikzpicture}
\draw (0,0) circle (1.2) ;
\draw (0,0) circle (1) ;
\draw (-1:0) rectangle (1:2) ;
\draw (119:0) rectangle (121:2) ; % not good
\end{tikzpicture}


So I think I would like to apply a transformation on these rectangles, but I don't know how I can do that. So how would you draw this logo with Tikz?

Moreover, Is it possible to apply different shading on each part of the logo?

You can create the gaps in the ring by drawing lines in the background color. In a similar manner, the circles on the outside can be drawn:

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[baseline=0]
\draw[black, line width=2mm] (0, 0) circle (1.1);
\draw[white, line width=2mm, overlay]
\foreach \a in {0, 120, 240} {
(0, 0) -- ++(\a:1.3)
}
;
\begin{tikzpicture}[baseline=0]
\fill[black] (0, 0) circle(1.2);
\foreach \a in {60, 180, 300} {
\fill[white] (\a:1.35) circle (.4);
\fill[black] (\a:1.35) circle (.3);
}
\end{tikzpicture}
\end{document}


The logo page of Ubuntu says:

The master logo is supplied as artwork and should never be altered, distorted or re-created in any way.

Trying to draw the logo to learn TikZ in privacy is probably ok, but such a "re-creation" is not permitted to be used very likely.

Also there is no much need, because the logos are provided as SVG files. The SVG data can even be used in TikZ, e.g.: the white on orange version consists of two tags <path fill="..." d="..."/>. The first draws a filled colored circle, the second puts the white elements inside. This can be easily translated to TikZ:

\documentclass{article}
\documentclass{article}
\usepackage{xcolor}
\usepackage{tikz}
\usetikzlibrary{svg.path}

\begin{document}
\begin{tikzpicture}
\definecolor{ubuntu-orange}{HTML}{DD4814}
\fill[ubuntu-orange] svg {...};
\fill[white] svg {...};
\end{tikzpicture}
\end{document}


The material inside the curly braces after svg is the contents of the attribute d of the tag <path> without quotes.

Here's a simple \foreach command to draw the Circle of Friends.

## Code

\documentclass[margin=10pt]{standalone}
\usepackage{graphicx}
\usepackage{tikz}
\pgfdeclarelayer{fg}
\pgfsetlayers{main,fg}

\definecolor{myred}{RGB}{212,0,0}
\definecolor{myorange}{RGB}{244,72,0}
\definecolor{myyellow}{RGB}{251,139,0}

\newcommand{\hug}[3]{
\begin{scope}[shift={(0,0)}, rotate=#1]
\begin{pgfonlayer}{fg}\node[rectangle, fill=white,rotate=#1, minimum height=3mm, minimum width=1.6cm] at (\rad,0) {};\end{pgfonlayer}
\end{scope}
}

\begin{document}
\begin{tikzpicture}
\foreach \angle/\cola/\colb  in {0/myorange/myred, 120/myyellow/myorange, 240/myorange/myyellow}{
\hug{\angle}{\cola}{\colb}
}
\end{tikzpicture}
\end{document}