# How to change the color of a section in ACM template?

I am trying to change the color of the name of a section in ACM template.

\section{\color{red} My Section}

I have found this solution but it did not work.

It gives the error of Undefined color RED

This is my code:

\documentclass[acmlarge]{acmart}

\settopmatter{printacmref=false}%
\fancyfoot{}

\makeatletter
\def\runningfoot{\def\@runningfoot{}}
\def\firstfoot{\def\@firstfoot{}}
\makeatother

\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage[mathscr]{euscript}
\usepackage{booktabs} % For formal tables

\begin{document}

\title{My Title}

\author{Me}

\maketitle

\thispagestyle{empty}

\section{\color{red} My Section}

This is my file. This is an algorithm, called \textsc{exp3}. Numbers like $1,2,3$ are not small caps.

\end{document}


As you can see in the log file, the error says ! Package xcolor Error: Undefined color RED. while you are using the red one! It's because of changing the case by section macro, therefore you have to prevent this action. The following will fix your issue by preventing uppercase. \lowercase macro also forces latex not to convert to uppercase.

\protected\def\mycolor{\color{red}}

\section{\mycolor My Section}
\section{\lowercase{\color{green}}My Section}