I have some trouble with tikz. I wanted to draw a flag in Tikz - but that with minimal success. Here a sketch:
The sketch is not how it should look like: the letters are just there so I am able to tell you what I actually wanted. The black rectangles shouldn't be there either, it should just show you the regions. It should just look like a green rectangle on a red rectangle with a star in the middle.
The letters are coordinates (in px). Here the coordinates:
The flag edges:
- N=(0, 300)
- M=(450, 0)
The star edges:
A=(200, 180)
B=(185, 135)
C=(225, 205)
D=(265, 135)
E=(250, 180)
Here is what I tried:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes,snakes}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{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{tikzpicture}
\fill[fill=grun] (0, 0) rectangle (12, 4.5);
\fill[fill=red] (0,4.5) rectangle (12, 9);
\end{tikzpicture}
\end{document}
Problems: I don't know why definecolor don't work for "rot" and "gelb". I don't know how to define the units for tikz (so instead of using cm I could write the coordinates in px and get an result). I don't know how to draw the star.
Bonus question: Is it possible to play with the scale of the done tikzpicture (so make it fill the whole page)? I thought of something like minipage? But that is not an important question, I am just curious for next Tikz projects.
Kind regards and thank you in advance!
x
andy
tikz options to specify base units. How is the star supposed to be drawn?