\setupoutput[pdftex]

\setupcolors[state=start]

\definetextbackground[foo]
  [backgroundcolor=lightgray,
   frame=off,
   level=-1, % -3,-2,-1,+1,+2
  ]

\startuniqueMPgraphic{bar}
fill OverlayBox withcolor red ;
\stopuniqueMPgraphic

\defineoverlay[bar][\uniqueMPgraphic{bar}]


\starttext

An example of a \starttextbackground[foo]textbackground\stoptextbackground.

\framed
{An example of a \starttextbackground[foo]textbackground\stoptextbackground.}

\framed[background=color,backgroundcolor=yellow] % level=-2
{An example of a \starttextbackground[foo]textbackground\stoptextbackground.}

\framed[background=bar] % level=-2
{An example of a \starttextbackground[foo]textbackground\stoptextbackground.}

\stoptext
