A black flag but it's easy to change the form or the colors
\documentclass[11pt]{scrartcl}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\begin{scope}[rotate=10]
\begin{scope}[every path/.style={fill=black}]
\draw (-.2,0) to [bend right] (.2,0) -- (.2,8) to [bend left] (-.2,8) -- cycle;
\draw (0,8) circle (.4) ;
\draw [rounded corners] (.2,7.6) to [out=60 ,in=180] (3,8) to [out=0, in = 200] (8,9) to [out=-85 ,in=85] (7.5,4) to [out=220,in=0](5,3) to [out=180,in=10] (.2,3) to [out =85,in=-80] (.2,7.6) ;
\end{scope}
\end{scope}
\end{tikzpicture}
\begin{tikzpicture}
\begin{scope}[rotate=10,scale=.5]
\begin{scope}[every path/.style={shade, top color=black,bottom color=darkgray}]
\draw (-.2,0) to [bend right] (.2,0) -- (.2,8) to [bend left] (-.2,8) -- cycle;
\draw (0,8) circle (.4) ;
\draw [rounded corners] (.2,7.6) to [out=60 ,in=180] (3,8) to [out=0, in = 200] (8,9) to [out=-85 ,in=85] (7.5,4) to [out=220,in=0](5,3) to [out=180,in=10] (.2,3) to [out =85,in=-80] (.2,7.6) ;
\end{scope}
\end{scope}
\end{tikzpicture}
\begin{tikzpicture}[scale=.5]
\begin{scope}[rotate=10]
\begin{scope}[every path/.style={fill=black}]
\draw (-.2,0) to [bend right] (.2,0) -- (.2,8) to [bend left] (-.2,8) -- cycle;
\draw (0,8) circle (.4) ;
\end{scope}
\begin{scope}
\clip [rounded corners] (.2,7.6) to [out=60 ,in=180] coordinate[pos=.95] (h1) (3,8) to [out=0, in = 200] coordinate[pos=.5] (h2) (8,9) coordinate(h3) to [out=-85 ,in=85] (7.5,4) coordinate(b3) to [out=220,in=0] coordinate[pos=.85] (b2)(5,3) to [out=180,in=10] coordinate[pos=.5] (b1)(.2,3) to [out =85,in=-80] (.2,7.6) ;
\fill[blue] (-1,9) -- (h1) to[out=-85,in=80] (b1) -- (0,0) --cycle;
\fill[red] (h2) to[out=-85,in=80] (b2) -- ++(0,-0.75) -- ([yshift=-1.25]b3) --(b3) to [out=85 ,in=-85] (h3) -- cycle ;
\end{scope}
\draw[thick] [rounded corners] (.2,7.6) to [out=60 ,in=180] coordinate[pos=.95] (h1) (3,8) to [out=0, in = 200] coordinate[pos=.5] (h2) (8,9) coordinate(h3) to [out=-85 ,in=85] (7.5,4) coordinate(b3) to [out=220,in=0] coordinate[pos=.85] (b2)(5,3) to [out=180,in=10] coordinate[pos=.5] (b1)(.2,3) to [out =85,in=-80] (.2,7.6) ;
\draw[thick] (h1) to[out=-85,in=80] (b1);
\draw[thick] (h2) to[out=-85,in=80] (b2);
\end{scope}
\end{tikzpicture}
\end{document}
Since adequate answers have already been given, I've felt free to do this picture with MetaPost.
For me it was an occasion to use some recent features of the luamplib
package, (which gives an interface to MetaPost in LuaLaTeX). More precisely, I've made use of the px
unit (which I didn't know of) thanks to the \mpdim
command, and of the integration of colors defined by the xcolor
package, via the \mpcolor
command.
The rectangle's dimensions follow the OP's first wishes, except for the star, for which it seems that several points are missing. So I've included a star of my own.
Edit I've made some minor changes, for the flag to be more like Burkina-Faso's official one, the way Paul Gaborit reports in its comment on the OP's question. So the red and green parts are reversed, and the star diameter is exactly one-third of the flag's height.
\documentclass{standalone}
\usepackage{luamplib, xcolor}
\definecolor{grun}{HTML}{239D48}%green - colour of the top rectangle
\definecolor{rot}{HTML}{BF0028}%red - colour of the bottom rectangle
\definecolor{gelb}{HTML}{F6eC0F}%yellow - colour of the star
\begin{document}
\begin{mplibcode}
u := \mpdim{1px}; % Unit length
beginfig(1);
z = u*(450, 300); path rect; rect = unitsquare xscaled x yscaled .5y;
% Star summits (I was not able to use the OP's given coordinates)
pair S[]; S0 = y/6*right rotated 18;
for i = 2 step 2 until 8: S[i] := S[i-2] rotated 72; endfor
for i = 1 step 2 until 9:
S[i] = whatever[S[(i-3) mod 10], S[(i+1) mod 10]] = whatever[S[i-1], S[(i+3) mod 10]];
endfor
% Drawings
fill rect withcolor \mpcolor{grun};
fill rect shifted (0, .5y) withcolor \mpcolor{rot};
fill S0 for i = 1 upto 9: -- S[i] endfor -- cycle shifted .5z withcolor \mpcolor{gelb};
endfig;
\end{mplibcode}
\end{document}
Best Answer
To enforce the nine different measurements one can use the
.is choice
key handler from thepgfkeys
stuff. I have reimplemented the flag code (which probably needs more fiddling to get the details of Ashoka Chakra exactly right). Note, that for the larger sizes of the flag, thex
andy
vectors need to be changed to avoiddimension too large
errors: