%!TEX pdflatex

\documentclass{article}
\usepackage{tcolorbox}
\usepackage{simplekv}
\tcbuselibrary{skins}
\usepackage{lipsum}

\makeatletter
\newlength\tikz@border@ornements@linewidth
\newlength\tikz@border@ornements@size

\newcommand\inttikzorncorner[2]{%
	\begin{scope}[line width=\tikz@border@ornements@linewidth,shift={(#1)},#2,tcboxornements@color,transform shape]
		\draw (0,\tikz@border@ornements@size) -- (0,0.1\tikz@border@ornements@size) -- (0.2\tikz@border@ornements@size,0.1\tikz@border@ornements@size) rectangle++ (-0.1\tikz@border@ornements@size,0.1\tikz@border@ornements@size) |- (\tikz@border@ornements@size,0) ;
		\draw (0.04\tikz@border@ornements@size,0.04\tikz@border@ornements@size) rectangle (0.26\tikz@border@ornements@size,0.26\tikz@border@ornements@size) ;
		\draw (0.04\tikz@border@ornements@size,0.35\tikz@border@ornements@size) -- (0.04\tikz@border@ornements@size,0.85\tikz@border@ornements@size) ;
		\draw (0.35\tikz@border@ornements@size,0.04\tikz@border@ornements@size) -- (0.85\tikz@border@ornements@size,0.04\tikz@border@ornements@size) ;
	\end{scope}
}

\tcbset{tikz bordures ornements/.style={%
		enhanced,%
		frame empty,
		boxsep=0.26\tikz@border@ornements@size,
		top=0.15mm,left=0.15mm,right=0.15mm,bottom=0.15mm,
		opacityfill=0,%
		finish unbroken={%
			\ifboolKV[tcboxornements]{alt deco}%
			{%
				\draw[line width=\tikz@border@ornements@linewidth,tcboxornements@color!25,opacity=0.5] ([shift={(0.26\tikz@border@ornements@size,0.26\tikz@border@ornements@size)}]frame.south west) rectangle ([shift={(-0.26\tikz@border@ornements@size,-0.26\tikz@border@ornements@size)}]frame.north east) ;
			}%
			{}%
			\begin{scope}
				\clip ([xshift=-0.5\tikz@border@ornements@linewidth,yshift=-0.5\tikz@border@ornements@linewidth]frame.south west) -- ([xshift=-0.5\tikz@border@ornements@linewidth]frame.west) -- ([yshift=-0.5\tikz@border@ornements@linewidth]frame.south) -- cycle ;
				\inttikzorncorner{frame.south west}{}
			\end{scope}
			\begin{scope}
				\clip ([xshift=-0.5\tikz@border@ornements@linewidth,yshift=0.5\tikz@border@ornements@linewidth]frame.north west) -- ([xshift=-0.5\tikz@border@ornements@linewidth]frame.west) -- ([yshift=0.5\tikz@border@ornements@linewidth]frame.north) -- cycle ;
				\inttikzorncorner{frame.north west}{yscale=-1}
			\end{scope}
			\begin{scope}
				\clip ([xshift=0.5\tikz@border@ornements@linewidth,yshift=0.5\tikz@border@ornements@linewidth]frame.north east) -- ([xshift=0.5\tikz@border@ornements@linewidth]frame.east) -- ([yshift=0.5\tikz@border@ornements@linewidth]frame.north) -- cycle ;
				\inttikzorncorner{frame.north east}{scale=-1}
			\end{scope}
			\begin{scope}
				\clip ([xshift=0.5\tikz@border@ornements@linewidth,yshift=-0.5\tikz@border@ornements@linewidth]frame.south east) -- ([xshift=0.5\tikz@border@ornements@linewidth]frame.east) -- ([yshift=-0.5\tikz@border@ornements@linewidth]frame.south) -- cycle ;
				\inttikzorncorner{frame.south east}{xscale=-1}
			\end{scope}
		}
	},
}

\defKV[tcboxornements]{%
	size deco=\setlength\tikz@border@ornements@size{#1},%
	color deco=\colorlet{tcboxornements@color}{#1}
}
\setKVdefault[tcboxornements]{%
	size deco=1.5cm,%
	color deco={black},%
	alt deco=false
}

\NewDocumentEnvironment{tcboxornements}{ O{} m }%
{%
	\restoreKV[tcboxornements]%
	\setKV[tcboxornements]{#1}%
	\setlength\tikz@border@ornements@linewidth{0.015\tikz@border@ornements@size}%
	\tcolorbox[tikz bordures ornements,#2]
}%
{%
	\endtcolorbox%
}%

\makeatother

\begin{document}

\begin{tcboxornements}{}
\lipsum[1][1-4]
\end{tcboxornements}

\begin{tcboxornements}[alt deco]{}
\lipsum[1][1-4]
\end{tcboxornements}

\begin{tcboxornements}[color deco=red!50!black]{}
\lipsum[2][1]
\end{tcboxornements}


\end{document}