ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Shading to transparent using withshademethod
@ 2016-01-27 21:05 Marco Patzer
  2016-01-28  8:43 ` Hans Hagen
  0 siblings, 1 reply; 12+ messages in thread
From: Marco Patzer @ 2016-01-27 21:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

some months ago the withshading, withfromshadecolor etc. have apparently been
replaced by the more general withshademethod, withshadevector,
withshadecolors, etc. methods.

I have issues converting the old withshading code to the withshademethod
version. The old code had no problems shading to transparent:

\definecolor [trans] [a=multiply, t=.5, s=.5]
\starttext
\startMPcode
  path p; p:=fullsquare xyscaled (8cm, 8cm);
  fill p
    withshading("linear", ulcorner p, llcorner p)
    withfromshadecolor \MPcolor{black}
    withtoshadecolor   \MPcolor{trans};
\stopMPcode
\stoptext

The new code appears to work in general, but only if no shading to
transparent is being used:

\definecolor [trans] [a=multiply, t=.5, s=.5]
\starttext
  \startMPcode
    % works
    fill fullcircle scaled 10cm withcolor \MPcolor{trans};

    fill fullsquare xyscaled (15cm, 15cm)
      withshademethod "linear"
      withshadevector (0,1)
      % works
      withshadecolors (red,\MPcolor{blue})
      % fails
      %% withshadecolors (red,\MPcolor{trans})
      ;
  \stopMPcode
\stoptext

How to make transparent shadings work with the new mechanism?

Marco
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2016-01-28 18:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-27 21:05 Shading to transparent using withshademethod Marco Patzer
2016-01-28  8:43 ` Hans Hagen
2016-01-28 10:45   ` Marco Patzer
2016-01-28 11:33     ` Hans Hagen
2016-01-28 12:53       ` Marco Patzer
2016-01-28 13:45         ` Hans Hagen
2016-01-28 14:34           ` Marco Patzer
2016-01-28 17:26             ` Hans Hagen
2016-01-28 18:09               ` Marco Patzer
2016-01-28 11:29   ` Hans Hagen
2016-01-28 13:02     ` Marco Patzer
2016-01-28 15:16       ` 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).