I would like to add some observations to Alan's answer, since I also ran into that issue, landed here and I see your question is only partially answered.
If you want operators like /
or *
coloured, too, you might get in trouble with comments in code. As literate
will break the way comments will be recognized by the listings
package. Here is an example:
/**
* This is a
* comment ...
**/
let java = s / c + r * i - p + t // and this is some code
Screenshot:

Now you want to highlight /
and *
in the equation, but it breaks the commets:
literate=%
{+}{{{\color{Red}+}}}1
{-}{{{\color{Red}-}}}1
{*}{{{\color{Red}*}}}1
{/}{{{\color{Red}/}}}1
{=}{{{\color{Red}=}}}1
Result:

Obviously, the comments both are broken. Now I played around with adding spaces to the pattern, but with insufficient results.
literate=%
{\ +}{{{\color{Red}\ +}}}1
{\ -}{{{\color{Red}\ -}}}1
{\ *}{{{\color{Red}\ *}}}1
{\ /}{{{\color{Red}\ /}}}1
{\ =}{{{\color{Red}\ =}}}1
The block comment is now recognized, but the one-line comment not.

So, why not appending a whitespace, too?
literate=%
{\ +\ }{{{\color{Red}\ +\ }}}1
{\ -\ }{{{\color{Red}\ -\ }}}1
{\ *\ }{{{\color{Red}\ *\ }}}1
{\ /\ }{{{\color{Red}\ /\ }}}1
{\ =\ }{{{\color{Red}\ =\ }}}1
This is the closest I could get to the desired result.

You can see it somehow shrinks the whitespaces. Some could dive into the dozens of different TeX whitespaces from here. But you'll get an idea.