\setupcolors[state=start]

\definecolor [MyFrameColor]    [b=.55, t=.5, a=1]


\startuniqueMPgraphic{fancyframe}{linewidth,radius,color}
begingroup
  save c, lw ;
  color c ; c:= \MPvar{color} ;
  lw:= \MPvar{linewidth} ;
  
  draw unitsquare xyscaled(OverlayWidth-lw,OverlayHeight-lw)
  smoothed \MPvar{radius}
  withpen pencircle scaled lw
  withcolor c ;
endgroup ;
\stopuniqueMPgraphic

\defineoverlay[fancyframe]
  [\uniqueMPgraphic{fancyframe}{linewidth=4pt,radius=5pt,color=MyFrameColor}]

\presetlocalframed[fancy]
\setuplocalframed[fancy]
  [frame=off,background=fancyframe]



\starttext

\framed 
[rulethickness=4pt,framecolor=MyFrameColor,height=8cm,width=8cm]{}

\localframed[fancy]
[height=8cm,width=8cm]{}

\stoptext
