I would like to have a macro that allows for alignment points inside it. As a specific example, I would like to be able to say:
\begin{align*}
a &= b\\
\bracr{c &= d}
\end{align*}
where \bracr places a round brackets around the argument.
This command would parse through the tokens until an alignment character is encountered. At this point it would insert a \right., add the alignment point, and then start a \left.
I realize that this example seems kind of trivial to do manually, but for now if I could just have a command such as the above brace that converts:
\bracr{c &= d}
to:
\left( c \right. & \left. = d\right)
Ultimately, I would like to add a \vphantom{c = d} to both sides of the equation to get the correct size brackets. I want to do a lot more with this, but need some help to get started as I don't know how to parse through the characters in #1.
Below is a code sample. Basically, I would like to uncomment out the lines below and have it be equivalent to the lines above (with approriate changes to the macro).
Another example, is where I want to color the particular formula as below.
\documentclass{article}
\usepackage{amsmath}
\usepackage{color}
\newcommand{\bracr}[1]{\left( #1 \right)} % not quite what is needed
\newcommand{\makeRed}[1]{\textcolor{red}{#1}} % also not quite as versatile as desired
\begin{document}
\begin{align*}
a &= b \\
\left( c \right. &= \left. d \right)\\
%\bracr{ c &= d }\\ % would prefer something like this instead
\makeRed{c}&\makeRed{= d}
%\makeRed{c &= d} % would prefer something like this instead
\end{align*}
\end{document}
Clarification: I would like this to be able to work independent of how many align points are provided.