I would like to draw a custom frame for the framed environment using Metafun. I am currently hard-coding the frame color within the Metafun definition. However, I would like the Metafun frame to reference the framecolor option of the framed environment and change color accordingly. This is what I have so far with hard-coded color options:
\startuniqueMPgraphic{box}
path p;
p := unitcircle xscaled \overlaywidth yscaled \overlayheight;
fill p withcolor .85white;
draw p withpen pencircle scaled 2pt withcolor .625red;
\stopuniqueMPgraphic
\defineoverlay[box][\uniqueMPgraphic{box}]
\starttext
\framed[framecolor=blue, background=box]{test}
\stoptext
Does the Metafun definition have access to framed options or is there another way to do this?

\[environment]parametertype command general? Could I use something similar in contexts outside of justframed? – ssokolen Jun 11 '18 at 20:20OverlayLineColorvariable to access theframecolorvalue. This variable and many others are listed in the MetaFun manual. – Wolfgang Schuster Jun 11 '18 at 20:43