8

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?

15

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)
    }
  ;  
\end{tikzpicture}\qquad
\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}

Result

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.

9

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

Output

figure1

Code

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

\newcommand\rad{3cm}
\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]
    \draw[#2, line width=1.5cm] (\rad,0) arc (0:120:\rad) node[circle, fill=#3, minimum size=1.8cm, draw=white, line width=2.8mm] at (57.5:\rad*1.2) {};
     \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}

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.