[Tex/LaTex] Using transparency with a color frame box

boxescolorframed

I am trying to make a semi transparent color framed box with \fcolorbox. It seems that the rules that make up the frame overlap. Is there a way to make a framebox like the one shown in the MWE below but with a consistent gray color? In my real use case the box is overlaying other text so needs to be transparent. Ideally, I would be able to control the transparency of the edges and fill separately.

\documentclass{article}
\usepackage{transparent}
\usepackage{xcolor}
\begin{document}
\setlength{\fboxrule}{20pt}
\transparent{0.5}%
\fcolorbox{black}{red}{\transparent{1.0}Hello World}
\end{document}

enter image description here

Best Answer

efbox provides an enhanced version of \fbox{} and friends, which seems to work fine with the transparency settings. For example:

\documentclass{article}
\usepackage{transparent}
\usepackage{xcolor}
\usepackage{efbox}
\begin{document}
\setlength{\fboxrule}{20pt}
\transparent{0.5}%
\efbox[backgroundcolor=red]{Hello World}
\efbox[backgroundcolor=red]{\transparent{1.0}Hello World}
\end{document}

slightly fancier boxes