# Is there an \arrayrulecolor-like command to change the rule color of \fbox?

The question has been written above.

## 2 Answers

You can use fcolorbox from the xcolor package or you can define your own command!

\documentclass{article}
\usepackage[kernelfbox]{xcolor}
\begin{document}

\def\twocolorbox#1#2#3{\color{#1}\fbox{\color{#2}#3}}

\twocolorbox{blue}{red}{terrible}

\fcolorbox{gray}{yellow}{test}
\end{document}

• Could you tell us what the order of arguments for \fcolorbox is?
– Joel
Feb 18 '16 at 1:06
\documentclass{article}
\usepackage{color}
\newcommand{\myfbox}[2]{\textcolor{#1}{\fbox{\normalcolor#2}}}
\begin{document}
\myfbox{red}{This is a test}
\end{document}


or

\documentclass{article}
\usepackage{color}
\newcommand{\myfbox}[2]{\fcolorbox{#1}{white}{#2}}
\begin{document}
\myfbox{red}{This is a test}
\end{document}