Peter Rolf wrote: > vardef define_linear_shade (expr a, b, ca, cb) = > hide (_defined_cs_ := _defined_cs_ + 1 ; > _defined_cs_pre_ [_defined_cs_] := "ls" ; > _defined_cs_post_[_defined_cs_] := "0 1 " & decimal shadefactor > & " " & > colordecimals ca & " " & ddecimal (a shifted shadeoffset) & " " > colordecimals cb & " " & ddecimal (b shifted shadeoffset) ) > _defined_cs_ > enddef ; > > same for define_circular_shade... > > % testfile --------------------------------- > % engine=luatex > \setupcolors[state=start] > \starttext > > \null > \startMPcode > path p; > p:= unitsquare xyscaled(10cm,1cm); > fill p withshade > define_linear_shade(p,1,red,blue); > \stopMPcode > > \stoptext
i uploaded a new beta but anyhow, your definition is wrong \startMPcode path p; p:= unitsquare xyscaled (10cm,1cm) ; fill p withshade (define_linear_shade(llcorner p, urcorner p,red,blue)) ; \stopMPcode so, the first two arguments are pairs ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ 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://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________