It's not very difficult to make a \pic
which draws the rectangle and its three parts. This way you can put nodes in it at your desired positions.
For example, the code:
\documentclass[border=2mm,tikz]{standalone}
\tikzset
{% USAGE:
% #1 = rectangle width
% #2 = rectangle height
% #3 = relative position of the first division (0-1), between left and middle rectangles
% #4 = relative position of the second division (0-1), between middle and right rectangles
% #5 = left part color
% #6 = middle part color
% #7 = right part color
pics/tricolor/.style n args={7}{%
code={%
\path[fill=#5] (0,0) rectangle (#1*#3,#2);
\path[fill=#6] (#1*#3,0) rectangle (#1*#4,#2);
\path[fill=#7] (#1*#4,0) rectangle (#1,#2);
\draw (0,0) rectangle (#1,#2);
\draw (#1*#3,0) --+ (0,#2);
\draw (#1*#4,0) --+ (0,#2);
\coordinate (-left) at (0.5*#1*#3 ,0.5*#2);
\coordinate (-middle) at ({0.5*#1*(#3+#4)},0.5*#2);
\coordinate (-right) at ({0.5*#1*(#4+1)} ,0.5*#2);
}}
}
\begin{document}
\begin{tikzpicture}
\pic (A) {tricolor={6}{1}{0.15}{0.6}{green!70!black}{red}{yellow}};
\node at (A-left) {left};
\node at (A-middle) {middle};
\node at (A-right) {right};
\pic (B) at (0.5,-4) {tricolor={5}{3}{0.33}{0.67}{blue!80}{white}{red}};
\node at (B-left) {Vive};
\node at (B-middle) {la};
\node at (B-right) {France};
\end{tikzpicture}
\end{document}
Will produce:

Edit: Introducing rounded corners, as requested. I draw first the left and right rectangles bigger and with rounded corners (as an option passed to the \pic
) and then the center rectangle over them and without rounded corners.
Note that if the radii of the corners is bigger than the width of the center rectangle it will not look good.
\documentclass[border=2mm,tikz]{standalone}
\tikzset
{% USAGE:
% #1 = rectangle width
% #2 = rectangle height
% #3 = relative position of the first division (0-1), between left and middle rectangles
% #4 = relative position of the second division (0-1), between middle and right rectangles
% #5 = left part color
% #6 = middle part color
% #7 = right part color
pics/tricolor/.style n args={7}{%
code={%
\path[fill=#5] (0,0) rectangle (#1*#4,#2);
\path[fill=#7] (#1*#3,0) rectangle (#1,#2);
\path[fill=#6,rounded corners=0] (#1*#3,0) rectangle (#1*#4,#2); % this rectangle without rounded corners
\draw (0,0) rectangle (#1,#2);
\draw (#1*#3,0) --+ (0,#2);
\draw (#1*#4,0) --+ (0,#2);
\coordinate (-left) at (0.5*#1*#3 ,0.5*#2);
\coordinate (-middle) at ({0.5*#1*(#3+#4)},0.5*#2);
\coordinate (-right) at ({0.5*#1*(#4+1)} ,0.5*#2);
}}
}
\begin{document}
\begin{tikzpicture}
\pic[rounded corners=0.5cm] (B) at (0.5,-4) {tricolor={5}{3}{0.33}{0.67}{blue!80}{white}{red}};
\node at (B-left) {Vive};
\node at (B-middle) {la};
\node at (B-right) {France};
\end{tikzpicture}
\end{document}

\documentclass[tikz,border=5mm]{standalone} \begin{document} \begin{tikzpicture}[thick,fill opacity=.5] \def\a{1} \def\b{3} \def\c{2} \draw[fill=red!] (0,0) rectangle +(\a,1) coordinate (B); \draw[fill=green] (B) rectangle +(\b,-1) coordinate (C); \draw[fill=blue] (C) rectangle +(\c,1); \end{tikzpicture} \end{document}
node
with the three-colored background