I'm getting better at creating \newcommand instances but I've just reached a part where my knowledge is just not enough for it and also reading this site or the manual doesn't help.
Basically I'd like to create a newcommand that sets a vertical rectangle split in 3 parts, so far so good, but where I can control whether each part gets filled with a boolean. The command would look like (as I've envisioned it but I'm not sure it's feasible):
\command{1, 0, 1}; Here the first and third part would be filled with a color (black or whatever), the second would stay white. Alternatively, it could be \command{1}{0}{1}; for the same result. This would use three arguments but I don't know how to separate arguments with the comma as shown above.
The result would be something like this:

Note that I'd like this to be dynamic, i.e. if I say 0,1,1, the filled parts would be the second and third, and so on. I didn't manage to reach any level so I don't have a code to provide but here is a starting example so you don't need to rewrite all the code (ignore the settings the seem to be unnecessary here, they're used in other parts of the document):
\documentclass[10pt]{article}
\usepackage[a4paper, margin=3mm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{rotating}
\usepackage{amsmath}
\usepackage{pgfplots}
\usepackage{tikz}
\usetikzlibrary{fit, arrows,backgrounds,patterns,shapes,shapes.multipart,positioning,calc,decorations.markings}
\begin{document}
\begin{tikzpicture}
\centering
\end{tikzpicture}
\end{document}



\node[rectangle, fill=black] at (0,0) {};? – Alenanno Apr 14 '13 at 13:01tikz-part. – Marco Daniel Apr 14 '13 at 13:33inner seporwidthetc. haven't been required. Maybe you can update your question and as egreg mentioned please show us your tikz-code. – Marco Daniel Apr 14 '13 at 14:03xparseandl3prop. The rest of my Tikz code is totally unrelated to this part so I don't see the benefit of including it. – Alenanno Apr 14 '13 at 14:19