I want to put a colored box in every theorem, example etc. Only the headtile and not it's contents. I've found an answer here which works for simple tetx. But is does not work for theorems, examples etc. I get an error "Use of \simpletitleshade doesn't match its definition T". Here's my code
\documentclass{article}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{tikz}
\def\simpletitleshade[#1]#2{\tikz[overlay]\node[fill=cyan,inner sep=2pt, anchor=text, rectangle, rounded corners=1mm,#1] {#2};\phantom{#2}}%
\declaretheoremstyle[headfont=\normalfont\bfseries\simpletitleshade,postheadspace=\newline]{simpleshaded}
\declaretheorem[style=simpleshaded,numberwithin=section,name=Example]{example}
\begin{document}
\begin{example}
Test
\end{example}
\end{document}
