改变内部练习的颜色

改变内部练习的颜色

我如何才能将练习中的颜色(灰色)更改为另一种颜色
在此处输入图片描述

\newtcolorbox[auto counter]{boxx}
{breakable,top=1cm,title={Exercice \thetcbcounter},enhanced,before skip=5mm,after skip=5mm,boxsep=3mm,coltitle=black,attach boxed title to top left={xshift=5mm,yshift=-\tcboxedtitleheight},boxrule=1.5pt,boxed title style={interior empty,frame code={
\fill([xshift=1mm]frame.north east)arc(180:0:1mm)([xshift=-1mm]frame.north west)arc(0:180:1mm);
\path[right color=blue!23!white,left color=blue!70!white,middle color=blue!13] ([shift={(-.2,.1)}]frame.north west)--([shift={(.2,.1)}]frame.north east)[rounded corners=1mm]--([xshift=.1cm]frame.north east)--(frame.south east)--(frame.south west)--([xshift=-.1cm]frame.north west)[sharp corners]--cycle;
}
}

答案1

欢迎!这就是关键colback所在。例如,添加colback=red!20收益

\documentclass{article} 
\usepackage[breakable,skins]{tcolorbox} 
\newtcolorbox[auto counter]{boxx}
{breakable,top=1cm,title={Exercice~\thetcbcounter},
enhanced,before skip=5mm,after skip=5mm,
boxsep=3mm,coltitle=black,colback=red!20,%<-
attach boxed title to top left={xshift=5mm,yshift=-\tcboxedtitleheight},boxrule=1.5pt,boxed title style={interior empty,frame code={
\fill([xshift=1mm]frame.north east)arc(180:0:1mm)([xshift=-1mm]frame.north west)arc(0:180:1mm);
\path[right color=blue!23!white,left color=blue!70!white,middle color=blue!13] ([shift={(-.2,.1)}]frame.north west)--([shift={(.2,.1)}]frame.north east)[rounded corners=1mm]--([xshift=.1cm]frame.north east)--(frame.south east)--(frame.south west)--([xshift=-.1cm]frame.north west)[sharp corners]--cycle;
}
}}
\begin{document}
\begin{boxx}
\begin{enumerate}
 \item A
 \item B
\end{enumerate}
\end{boxx}
\end{document}

在此处输入图片描述

相关内容