This should do what you want. It simply modifies \hangsecnum to be blue for the section number.
\documentclass[article]{memoir}
\usepackage{xcolor}
\setcounter{secnumdepth}{3}
\makeatletter
\renewcommand{\hangsecnum}{%
\def\@seccntformat##1{%
\makebox[0pt][r]{%
\color{blue}%
\csname the##1\endcsname
\quad
}%
}%
}
\makeatother
\setsechook{\hangsecnum}
\setsubsechook{\defaultsecnum}
\begin{document}
\section{First Section}
\subsection{First Subsection}
\subsubsection{First Subsubsection}
I would like hanging, styled section numbers while using the memoir
class. The answer customizing section formatting using memoir class
(color and numbering) explains how to style just the numbers, and the
answer Hang section number, but not subsection number in Memoir
explains how to hang the section number. However, when I attempt to
combine these, my styling vanishes!
\section{Second Section}
\subsection{Second Subsection}
\subsubsection{Second Subsubsection}
I would like hanging, styled section numbers while using the memoir
class. The answer customizing section formatting using memoir class
(color and numbering) explains how to style just the numbers, and the
answer Hang section number, but not subsection number in Memoir
explains how to hang the section number. However, when I attempt to
combine these, my styling vanishes!
\end{document}
\hangsecnumis an already defined secnumformat. So line two kills the format you just set. You can just copy the inner code from jons answer, you're basically just missing\llap, then you do not need to redefine\hangsecnum– daleif Oct 25 '16 at 05:43