My suggestion is to define named colors for math mode (so you only have to change them and not those in \colorizemath) and overwrite them manually in an \mathcolor macro.
Previously, I have used \colorlet but that doesn’t work with the [<model>]{<color>} syntax, so I simply used \definecolor.
The reason for the \begingroup and \endgroup rather than { } comes from Heiko Oberdiek’s answer to Colored symbols.
Code
\documentclass{article}
\usepackage{xcolor}
% Defining various math colors
\colorlet{math@latin@upper} {green}
\colorlet{math@latin@lower} {green}
\colorlet{math@digit} {red}
\colorlet{math@everymath} {blue}
\colorlet{math@everydisplay}{blue}
% Setting math colors for whole content
\everymath{\color{math@everymath}}
\everydisplay{\color{math@everydisplay}}
% Setting colors for letters and digits
% Author: user700902
% Source: https://tex.stackexchange.com/a/100625/16595
\makeatletter
\def\colorizemath #1#2{%
\expandafter\mathchardef\csname orig:math:#1\endcsname\mathcode`#1
\mathcode`#1="8000
\toks@\expandafter{\csname orig:math:#1\endcsname}%
\begingroup
\lccode`~=`#1
\lowercase{%
\endgroup
\edef~{{\noexpand\color{#2}\the\toks@}}}%
}
\@for\@tempa:=a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z\do{%
\expandafter\colorizemath\@tempa{math@latin@lower}}
\@for\@tempa:=A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z\do{%
\expandafter\colorizemath\@tempa{math@latin@upper}}
\@for\@tempa:=0,1,2,3,4,5,6,7,8,9\do{%
\expandafter\colorizemath\@tempa{math@digit}}
\makeatother
% Using color in math-mode,
% extended to overwrite the color invoked by active letters and digits
% Author: Heiko Oberdiek
% Source: https://tex.stackexchange.com/a/85035/16595
\newcommand*{\mathcolor}[3][named]{%
\protect\leavevmode
\begingroup
\definecolor{math@latin@upper}{#1}{#2}%
\definecolor{math@latin@lower}{#1}{#2}%
\definecolor{math@digit}{#1}{#2}%
\color[#1]{#2}%
#3%
\endgroup
}
\begin{document}\thispagestyle{empty}
\[
P\begingroup\colorlet{math@latin@upper}{red}Q\endgroup RST
\mathcolor{yellow}{=}
P\mathcolor{red}{Q}RST
\mathcolor[gray]{.5}{\sim} PQRST
\]
\end{document}
Output

\colorlet{green}{red}? – Qrrbrbirlbel Mar 03 '13 at 02:31$P\text{\textcolor{red}{\emph{Q}}}RST$? Here,\textis a command provided by theamsmathpackage. (Of course, this presupposes that the text-italic "Q" and the math-italic "Q" letters are (very) similar. That's the case for Computer Modern, but needn't be true for other font families.) – Mico Mar 03 '13 at 02:48\colorletmacro needs thexcolorpackage:$P\begingroup\colorlet{green}{red}Q\endgroup RST$. – Qrrbrbirlbel Mar 03 '13 at 02:48