\setuppagenumber[state=stop]
\setupcolors[state=start]

\definecolor[colorA] [red]
\definecolor[colorB] [green]
\definecolor[colorC] [blue]

\newconditional\CondA
\newconditional\CondB
\newconditional\CondC


\unprotect

\def\CurrentStateDependentColor{}

\def\GetStateDependentColor#1%
  {\bgroup
   \rawgetparameters[SDC@][A=,B=,C=,#1]%
   \def\docommand##1%
     {\doifdefined{Cond##1} % conditional is known..
        {\expandafter\ifconditional\csname Cond##1\endcsname % ..AND true..
           \doifsomething{\csname SDC@##1\endcsname} % ..AND a color is assigned
             \donetrue
         \else\donefalse\fi}%
      \ifdone\xdef\CurrentStateDependentColor{\csname SDC@##1\endcsname}%
        \expandafter\quitcommalist\fi}%
   \processcommacommand[A,B,C]\docommand % raw version does not work! why?
   \egroup}


\protect


\starttext

%\settrue\CondA
\settrue\CondB
\settrue\CondC

%\tracingonline=1
%\tracingall=1
%\tracingmacros=1
%\tracingcommands=2
\GetStateDependentColor{A=colorA,C=colorC}
%\definecolor[testcolor][\TESTcolor]
\switchtocolor[\CurrentStateDependentColor]
%\tracingmacros=0
%\tracingall=0
THANK YOU TACO!!!

\stoptext
