I am trying to add a centrally aligned text in the middle of each horizontal bar, but can't seem to figure out how. How can I best do that?
\documentclass{article}
\usepackage{xcolor}
\usepackage{tikz}
\definecolor{high}{rgb}{0.89, 0.26, 0.2}
\definecolor{med}{rgb}{1.0, 0.65, 0.0}
\definecolor{low}{rgb}{0.98, 0.93, 0.36}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\foreach \l/\x/\c[count=\y] in {A/6/high, B/4/med, C/2/low}
{\node[left] at (0,\y) {\l};
\draw[fill=\c] (0,\y-.4) rectangle (\x,\y+.4);}
\end{tikzpicture}
\end{figure}
\end{document}