Here's my current preamble.tex
\documentclass{report}
% basics
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{sidenotes}
\usepackage{textcomp}
\usepackage{url}
\usepackage{hyperref}
\hypersetup{
colorlinks,
linkcolor={black},
citecolor={black},
urlcolor={blue!80!black}
}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{float}
\usepackage{booktabs}
\usepackage[shortlabels]{enumitem}
\usepackage{emptypage}
\usepackage{subcaption}
\usepackage{multicol}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{amsmath, amsfonts, mathtools, amsthm, amssymb}
\usepackage{mathrsfs}
\usepackage{cancel}
\usepackage{bm}
\usepackage{systeme}
\usepackage{stmaryrd}
% theorems
\usepackage{thmtools}
\usepackage[framemethod=TikZ]{mdframed}
\mdfsetup{skipabove=1em,skipbelow=0em, innertopmargin=5pt, innerbottommargin=6pt}
\theoremstyle{definition}
\makeatletter
@ifclasswith{report}{nocolor}{
\declaretheoremstyle[headfont=\bfseries\sffamily, bodyfont=\normalfont, mdframed={ nobreak } ]{thmgreenbox}
\declaretheoremstyle[headfont=\bfseries\sffamily, bodyfont=\normalfont, mdframed={ nobreak } ]{thmredbox}
\declaretheoremstyle[headfont=\bfseries\sffamily, bodyfont=\normalfont]{thmbluebox}
\declaretheoremstyle[headfont=\bfseries\sffamily, bodyfont=\normalfont]{thmblueline}
\declaretheoremstyle[headfont=\bfseries\sffamily, bodyfont=\normalfont, numbered=no, mdframed={ rightline=false, topline=false, bottomline=false, }, qed=\qedsymbol ]{thmproofbox}
\declaretheoremstyle[headfont=\bfseries\sffamily, bodyfont=\normalfont, numbered=no, mdframed={ nobreak, rightline=false, topline=false, bottomline=false } ]{thmexplanationbox}
\AtEndEnvironment{eg}{\null\hfill$\diamond$}%
}{
\declaretheoremstyle[
headfont=\bfseries\sffamily\color{ForestGreen!70!black}, bodyfont=\normalfont,
mdframed={
linewidth=2pt,
rightline=false, topline=false, bottomline=false,
linecolor=ForestGreen, backgroundcolor=ForestGreen!5,
}
]{thmgreenbox}
\declaretheoremstyle[
headfont=\bfseries\sffamily\color{NavyBlue!70!black}, bodyfont=\normalfont,
mdframed={
linewidth=2pt,
rightline=false, topline=false, bottomline=false,
linecolor=NavyBlue, backgroundcolor=NavyBlue!5,
}
]{thmbluebox}
\declaretheoremstyle[
headfont=\bfseries\sffamily\color{NavyBlue!70!black}, bodyfont=\normalfont,
mdframed={
linewidth=2pt,
rightline=false, topline=false, bottomline=false,
linecolor=NavyBlue
}
]{thmblueline}
\declaretheoremstyle[
headfont=\bfseries\sffamily\color{RawSienna!70!black}, bodyfont=\normalfont,
mdframed={
linewidth=2pt,
rightline=false, topline=false, bottomline=false,
linecolor=RawSienna, backgroundcolor=RawSienna!5,
}
]{thmredbox}
\declaretheoremstyle[
headfont=\bfseries\sffamily\color{RawSienna!70!black}, bodyfont=\normalfont,
numbered=no,
mdframed={
linewidth=2pt,
rightline=false, topline=false, bottomline=false,
linecolor=RawSienna, backgroundcolor=RawSienna!1,
},
qed=\color{RawSienna!70!black}\qedsymbol
]{thmproofbox}
\declaretheoremstyle[
headfont=\bfseries\sffamily\color{NavyBlue!70!black}, bodyfont=\normalfont,
numbered=no,
mdframed={
linewidth=2pt,
rightline=false, topline=false, bottomline=false,
linecolor=NavyBlue, backgroundcolor=NavyBlue!1,
},
]{thmexplanationbox}
}
@ifclasswith{report}{nocolor}{
\declaretheorem[style=thmproofbox, name=Proof]{replacementproof}
\declaretheorem[style=thmexplanationbox, name=Proof]{explanation}
\renewenvironment{proof}[1][\proofname]{\begin{replacementproof}}{\end{replacementproof}}
}{
\declaretheorem[style=thmproofbox, name=Proof]{replacementproof}
\renewenvironment{proof}[1][\proofname]{\vspace{-10pt}\begin{replacementproof}}{\end{replacementproof}}
\declaretheorem[style=thmexplanationbox, name=Proof]{tmpexplanation}
\newenvironment{explanation}[1][]{\vspace{-10pt}\begin{tmpexplanation}}{\end{tmpexplanation}}
}
\makeatother
\declaretheorem[style=thmgreenbox, name=Definition]{definition}
\declaretheorem[style=thmredbox, name=Proposition]{prop}
\declaretheorem[style=thmredbox, name=Theorem]{theorem}
\declaretheorem[style=thmredbox, name=Lemma]{lemma}
\declaretheorem[style=thmredbox, numbered=no, name=Corollary]{corollary}
\declaretheorem[style=thmblueline, numbered=no, name=Remark]{remark}
\declaretheorem[style=thmblueline, numbered=no, name=Example]{example}
\declaretheorem[style=thmblueline, numbered=no, name=Solution]{solution}
\newtheorem{exc}{Exercise}
\newtheorem{notation}{Notation}
\newtheorem{note}{Note}
\newtheorem{previouslyseen}{As previously seen}
\newtheorem{problem}{Problem}
\newtheorem{observe}{Observe}
\newtheorem{property}{Property}
\newtheorem*{intuition}{Intuition}
\begin{document}
\begin{definition}
\begin{table}[H]
\label{tbl:degrees_into_radians}
\begin{tabular}{|c|c|c|c|}
\hline
$1$, $2$, $3$, $4$
\hline
\end{tabular}
\caption{Some Cool Label}
\end{table}
\end{definition}
\end{document}
How can I get the label color to change to the color of the border from the environment? In this example, how would I change the label color to be green like the definition environment?





\documentclassline anddocumentenvironment. – muzimuzhi Z Apr 09 '22 at 00:41\AtBeinEnvironment{<envname>}{\hypersetup{linkcolor=<color>}}may work. – muzimuzhi Z Apr 09 '22 at 00:44