[Tex/LaTex] Html color in mdframed

colorhtmlmdframed

I want to make mdframed with linecolor set using HTML color model. How can i do it?
I want something like

\begin{mdframed}[linecolor=\color[HTML]{FF0013}]
    text
\end{mdframed}

Best Answer

Maybe the simplest is to load xcolor with option svgnames: the svg colour names are the html colours names. So you can write:

\begin{mdframed}[linecolor=DarkSeaGreen]
    text
\end{mdframed}

To use the HTML hexacimal code, you first have to define your colour:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[svgnames]{xcolor}
\usepackage{mdframed}
\definecolor{myframecolour}{HTML}{FF0013}

\begin{document}

    \begin{mdframed}[linecolor=DarkSeaGreen, linewidth = 2pt]
     Text text text text text text text text text text text text text text text text text
    \end{mdframed}

    \begin{mdframed}[linecolor=myframecolour, linewidth = 2pt]
     Text text text text text text text text text text text text text text text text text
    \end{mdframed}

\end{document} 

enter image description here

Related Question