What goes wrong with this code using xetex engine? No issues with pdftex and luatex. \setupcolors[state=start] \definecolor[a][yellow] \definecolor[b][s=.4] \definecolor[c][darkyellow] \definecolor[d][green] \definecolor[e][s=.4] \definecolor[f][darkgreen] \defineoverlay[my shade][\uniqueMPgraphic{MyShade}] \defineoverlay[circular shade][\uniqueMPgraphic{CircularShade}] \defineoverlay[linear shade] [\uniqueMPgraphic{LinearShade}] \startuniqueMPgraphic{LinearShade} path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ; linear_shade(p,0,\MPcolor{a},\MPcolor{b}); \stopuniqueMPgraphic \startuniqueMPgraphic{CircularShade} path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ; circular_shade(p,2,\MPcolor{a},\MPcolor{b}) ; \stopuniqueMPgraphic \startuniqueMPgraphic{MyShade} path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ; circular_shade(p,3,\MPcolor{f},\MPcolor{e}) ; \stopuniqueMPgraphic \starttext \framed[background=circular shade] {frame 1} \framed[background=linear shade] {frame 2} \framed[background=my shade] {frame 3} \stoptext Cheers -- Diego Depaoli