I need to get different color edges for my rectangular nodes.
I found this question How do I set only one side of a tikz node's border color?
The \tikzset mentioned in the answer has input arguments and I don't know how to set them when used with \node.
I have tried to remove the arguments and set the styles but the all I get is a xetex in infinite loop.
\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\tikzset{%
mynode/.style ={
\draw[thick,red,line cap=butt,shorten <= -0.5\pgflinewidth,shorten >= 0.5\pgflinewidth] (a.south west) |- (a.north east);
\draw[thick,blue,line cap=butt,shorten <= 0.5\pgflinewidth,shorten >= -0.5\pgflinewidth] (a.south west) -| (a.north east);
}
}
\begin{document}
\begin{figure}[ht]
\begin{center}
\begin{tikzpicture}
\tikzstyle{main}=[rectangle, minimum width = 30mm,minimum height = 50mm, thick, draw =black!80, node distance = 6mm]
\node[main] (m) {$A$ };
\node[mynode] [right=of m] (x2) { $R$}; %commenting this line out with eliminate the infinite loop
\end{tikzpicture}
\end{center}
\end{figure}
\end{document}
thanks in advance

