\nopdfcompression
\setuppagenumber[state=stop]


\definecolor[foo][r=1,g=0,b=0,,a=1,t=.5]
%\definecolor[foo][r=1,g=0,b=0]

\startuniqueMPgraphic{foo}{color}
    rgbcolor c;
    % this only works with non transparent colors; otherwise...
%    c:= \MPvar{color}; % ...:  ! Equation cannot be performed (color=numeric).
    % works with non|transparent colors, but grayscale conversion!!
    c:= \MPcolor{\MPvar{color}};

    fill OverlayBox scaled .25 withcolor c;
    fill OverlayBox scaled .50 withcolor transparent(normaltransparent,.5,c);
    fill OverlayBox scaled 1.0 withcolor c withtransparency(normaltransparent,.5);

    label(decimal(redpart c) & "," & decimal(greenpart c) & "," & decimal(bluepart c),center(OverlayBox));
\stopuniqueMPgraphic

\defineoverlay[foo][\uniqueMPgraphic{foo}{color=foo}]

\starttext

\framed[width=10cm,height=2cm,frame=on,background=foo]{}

\stoptext
