On Mon, 24 Jul 2017, Alan Braslau wrote:

On Mon, 24 Jul 2017 10:26:25 +0200
Hans Hagen <pra...@wxs.nl> wrote:

On 7/24/2017 1:40 AM, Aditya Mahajan wrote:
Hi,

Is it possible to set pen width using properties(...)? The
following does not work (the color is set, but not the pen width):

\starttext
\startMPcode
property p[] ;
p[1] := properties(withcolor red  withpen pencircle scaled 1bp);
p[2] := properties(withcolor blue withpen pencircle scaled 10bp);

draw fullcircle scaled 1cm withproperties p[1];
draw fullcircle scaled 2cm withproperties p[2];
\stopMPcode
\stoptext

def withproperties expr p =
     if colormodel p = 3 :
         withcolor greypart p
     elseif colormodel p = 5 :
         withcolor (redpart p,greenpart p,bluepart p)
     elseif colormodel p = 7 :
         withcolor (cyanpart p,magentapart p,yellowpart p,blackpart p)
     fi
     withpen penpart p

      if dashpart p <> nullpicture :
        dashed dashpart p
      fi

     withprescript prescriptpart p
     withpostscript postscriptpart p
enddef ;

Thanks!

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to