ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* shading question
@ 2000-10-31 21:29 Denis B. Roegel
  2000-10-31 22:02 ` shading, Trying shading example, missing metafun.mem Thomas Porter
  2000-11-01  8:12 ` shading question Hans Hagen
  0 siblings, 2 replies; 4+ messages in thread
From: Denis B. Roegel @ 2000-10-31 21:29 UTC (permalink / raw)
  Cc: roegel

In the following example, the top parts of the circles are
slightly trimmed, at least when I view them with acroread.
Is this normal?

Thanks,

Denis

\setupcolors[state=start]
\starttext

\definecolor[a][darkyellow]
\definecolor[b][s=.8]
\definecolor[c][darkred]

\startuniqueMPgraphic{CircularShade}
  path p;
  p:= unitsquare xscaled \overlaywidth yscaled \overlayheight ;
  circular_shade(p,0,\MPcolor{a},\MPcolor{b});
\stopuniqueMPgraphic

\startuniqueMPgraphic{LinearShade}
  path p;
  p:= unitsquare xscaled \overlaywidth yscaled \overlayheight ;
  linear_shade(p,0,\MPcolor{a},\MPcolor{b});
\stopuniqueMPgraphic

\defineoverlay[circular shade][\uniqueMPgraphic{CircularShade}]
\defineoverlay[linear shade]  [\uniqueMPgraphic{LinearShade}]

\framed
  [background=circular shade,frame=off]
  {\bf \white Hi there, I'm Circular!}

\framed
  [background=linear shade,frame=off]
  {\bf \white Whow, this is Linear!}

\startuniqueMPgraphic{test}
path p; p:=fullcircle scaled 1cm;
for i:= 0 step 2cm until 8cm:
  circular_shade(p shifted (i,0),0,\MPcolor{a},\MPcolor{b});
endfor;
\stopuniqueMPgraphic

\useMPgraphic{test}

\startuniqueMPgraphic{test1}
circular_shade(fullcircle scaled 1cm,0,\MPcolor{a},\MPcolor{b});
picture s; s:=currentpicture; currentpicture := nullpicture;
for i=0 step 2cm until 8cm:
  addto currentpicture also s shifted (i,0);
endfor;
\stopuniqueMPgraphic

\useMPgraphic{test1}

\startuniqueMPgraphic{test2}
sh:=define_circular_shade(origin,origin,0,8cm,\MPcolor{a},\MPcolor{b});
for i=0 step 2cm until 8cm:
  fill fullcircle scaled 1cm shifted (i,0) withshade sh;
endfor;
\stopuniqueMPgraphic

\useMPgraphic{test2}

\stoptext


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-11-01  8:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-31 21:29 shading question Denis B. Roegel
2000-10-31 22:02 ` shading, Trying shading example, missing metafun.mem Thomas Porter
2000-10-31 22:45   ` Christopher Tipper
2000-11-01  8:12 ` shading question Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).