读文档第九章第四节 drawing scheme

改用finish而不是overlay app即可。
另外,既然文字需要被「装饰」遮盖住,那这个文字被排出来的作用是什么呢? 建议提供一下具体的应用场景。
\documentclass{article}
\usepackage[UTF8]{ctex}
\usepackage[most]{tcolorbox}
\usetikzlibrary{patterns}
\usepackage{zhlipsum}
\begin{document}
\tcbset{
frogbox/.style={
enhanced,
colback=green!10,
colframe=green!65!black,
enlarge top by=5.5mm,
overlay={
\foreach \x in {2cm, 3.5cm} {
\begin{scope}[shift={([xshift=\x]frame.north west)}]
\path[draw=green!65!black, fill=green!10, line width=1mm] (0,0) arc (0:180:5mm);
\path[fill=black] (-0.2,0) arc (0:180:1mm);
\end{scope}
}
}
},
ribbon/.style={
finish={
\path[
fill=blue!75!white,
draw=blue,
double=white!85!blue,
preaction={fill=blue!75!white},
line width=0.1mm,
double distance=0.2mm,
pattern=fivepointed stars,
pattern color=white!75!blue
]
([xshift=-0.2mm, yshift=-2.02cm]frame.north east)
-- ++(-2,2)
-- ++(-0.5,0)
-- ++(2.5,-2.5)
-- cycle;
}
}
}
\begin{tcolorbox}[frogbox, ribbon, title=My title]
\zhlipsum[1]
\end{tcolorbox}
\end{document}


























问 tcolorbox宏包overlay绘图透明度问题