\usepackage{newtxtext}
\usepackage[dvipsnames,svgnames]{xcolor}
\usepackage[strict]{changepage} % 提供一个 adjustwidth 环境
\usepackage{framed} % 实现方框效果

% environment derived from framed.sty: see leftbar environment definition
\definecolor{redshade}{rgb}{1.00,0.90,0.90} % 竖线设置为LightCoral
\definecolor{greenshade}{rgb}{0.90,0.99,0.91} % 竖线设置为Green
\definecolor{brownshade}{rgb}{0.99,0.97,0.93} % 竖线设置为BurlyWood
\definecolor{blueshade}{rgb}{0.95,0.95,1} % 竖线设置为
\definecolor{grayshade}{rgb}{0.90,0.90,0.90} % 竖线设置为gray

\newenvironment{colordefinition}{
\def\FrameCommand{
\hspace{1pt}
{\color{LightCoral}\vrule width 2pt}%
{\color{redshade}\vrule width 4pt}%
\colorbox{redshade}%
}
\MakeFramed{\advance\hsize-\width\FrameRestore}
\noindent\hspace{-4.55pt}
\begin{adjustwidth}{}{7pt}
\vspace{2pt}\vspace{2pt}
}
{
\vspace{2pt}\end{adjustwidth}\endMakeFramed
}

\newenvironment{colorexample}{
\def\FrameCommand{
\hspace{1pt}
{\color{DarkBlue}\vrule width 2pt}%
{\color{blueshade}\vrule width 4pt}%
\colorbox{blueshade}%
}
\MakeFramed{\advance\hsize-\width\FrameRestore}
\noindent\hspace{-4.55pt}
\begin{adjustwidth}{}{7pt}
\vspace{2pt}\vspace{2pt}
}
{
\vspace{2pt}\end{adjustwidth}\endMakeFramed
}

\newenvironment{colortheorem}{
\def\FrameCommand{
\hspace{1pt}
{\color{Green}\vrule width 2pt}%
{\color{greenshade}\vrule width 4pt}%
\colorbox{greenshade}%
}
\MakeFramed{\advance\hsize-\width\FrameRestore}
\noindent\hspace{-4.55pt}
\begin{adjustwidth}{}{7pt}
\vspace{2pt}\vspace{2pt}
}
{
\vspace{2pt}\end{adjustwidth}\endMakeFramed
}

\newenvironment{colorproof}{
\def\FrameCommand{
\hspace{1pt}
{\color{BurlyWood}\vrule width 2pt}%
{\color{brownshade}\vrule width 4pt}%
\colorbox{brownshade}%
}
\MakeFramed{\advance\hsize-\width\FrameRestore}
\noindent\hspace{-4.55pt}
\begin{adjustwidth}{}{7pt}
\vspace{2pt}\vspace{2pt}
}
{
\vspace{2pt}\end{adjustwidth}\endMakeFramed
}

\newenvironment{colorcorollary}{
\def\FrameCommand{
\hspace{1pt}
{\color{gray}\vrule width 2pt}%
{\color{grayshade}\vrule width 4pt}%
\colorbox{grayshade}%
}
\MakeFramed{\advance\hsize-\width\FrameRestore}
\noindent\hspace{-4.55pt}
\begin{adjustwidth}{}{7pt}
\vspace{2pt}\vspace{2pt}
}
{
\vspace{2pt}\end{adjustwidth}\endMakeFramed
}