[Tex/LaTex] tikz: Draw rectangle with rounded corners only north/south

rounded-cornerstikz-pgf

I'm trying to draw two rectangles (using \fill and a cycle) where only the north/south corners are rounded. I want the blue rectangle below to have rounded corners only on the top, and I want the red rectangle on the bottom to have rounded corners only on the bottom.

Code:

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{figure}[h]
\centering

\begin{tikzpicture}
\fill [blue,rounded corners=10, draw]
  (0,0) --
  ++(5,0) --
  ++(0,5) --
  ++(-5,0) --
  cycle
  {};
\fill [red,rounded corners=10, draw]
  (0,0) --
  ++(5,0) --
  ++(0,-5) --
  ++(-5,0) --
  cycle
  {};
\end{tikzpicture}

\end{figure}

\end{document}

Output:
enter image description here

Can someone help me with this?

These questions might hint on solutions, but I couldn't get it to work with \fill or \draw:
Rounded corners on only one side of a TikZ node
Draw a rectangle with rounded ends in TikZ
TikZ rectangular node with different rounded corners

Best Answer

Thank you for your suggestions! I liked the method proposed in the answer Torbjørn T. linked to the most, so I'm answering here myself.

Code:

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{figure}[h]
\centering

\begin{tikzpicture}
\fill [blue,draw]
  (0,0) --
  ++(5,0) {[rounded corners=10] --
  ++(0,5) --
  ++(-5,0)} --
  cycle
  {};
\fill [red,draw]
  (0,0) --
  ++(5,0) {[rounded corners=10] --
  ++(0,-5) --
  ++(-5,0)} --
  cycle
  {};
\end{tikzpicture}

\end{figure}

\end{document}

Output:
enter image description here