To very first approximation I would just take the answer you refer to, remove the chapter stuff and add the colors.
\documentclass{article}
\usepackage{etoolbox}
\usepackage{tcolorbox}
\tcbuselibrary{skins,breakable}
\usepackage{lipsum}
\tcbset{mytitle/.style={title={Example~\thetcbcounter\ifstrempty{#1}{}{: #1}}}}
\newtcolorbox[auto counter, number within=chapter,
number freestyle={\noexpand\arabic{\tcbcounter}}]{myexample}[1][]{%
enhanced,
breakable,
fonttitle=\bfseries,
mytitle={},
#1
}
\begin{document}
\begin{myexample}[colback=red!5!white,colframe=red!75!black,mytitle={First example}, label=exfirst]
\lipsum[4]
\end{myexample}
\begin{myexample}[colback=red!5!white,colframe=blue!75!black]
\lipsum[4]
\end{myexample}
\begin{myexample}[colback=red!5!white,colframe=red!75!black,mytitle={Third example}, label=exthird]
\lipsum[4]
\end{myexample}
I can now refer to example~\ref{exfirst} and example~\ref{exthird}.
\end{document}

EDIT: One way to deal with the color issue is to introduce new macros.
\documentclass{article}
\usepackage{etoolbox}
\usepackage{tcolorbox}
\tcbuselibrary{skins,breakable}
\usepackage{lipsum}
\tcbset{mytitle/.style={title={Example~\thetcbcounter\ifstrempty{#1}{}{: #1}}}}
\newtcolorbox[auto counter, number within=chapter,
number freestyle={\noexpand\arabic{\tcbcounter}}]{myexample}[1][]{%
enhanced,
breakable,
fonttitle=\bfseries,
mytitle={},
#1
}
\newcommand{\BlueBox}[3][]{
\begin{myexample}[colback=blue!5!white,colframe=blue!75!black,mytitle={#2},#1]
#3
\end{myexample}
}
\newcommand{\RedBox}[3][]{
\begin{myexample}[colback=blue!5!white,colframe=red!75!black,mytitle={#2},#1]
#3
\end{myexample}
}
\begin{document}
\RedBox[label=exfirst]{First Example}{\lipsum[1]}
\BlueBox[label=exsecond]{}{\lipsum[2]}
\RedBox[label=exthird]{Third Example}{\lipsum[3]}
I can now refer to example~\ref{exfirst} and example~\ref{exthird}.
\end{document}