ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Marco <netuse@lavabit.com>
To: ntg-context@ntg.nl
Subject: Re: shading
Date: Thu, 19 May 2011 12:08:52 +0200	[thread overview]
Message-ID: <20110519120852.58e85a36@glyph> (raw)
In-Reply-To: <4DD42AFB.1080501@wxs.nl>

On 2011-05-18 Hans Hagen <pragma@wxs.nl> wrote:

> On 18-5-2011 8:30, Marco wrote:
> 
> > % Error
> > % path p; p:=fullsquare scaled 5cm shifted (10cm, 0cm);
> > % fill p
> > %   withshading("linear", llcorner p, urcorner p)
> > %   withcolor \MPcolor{red-t} shadedinto \MPcolor{blue};
> 
> don't ask how, but the upcoming beta can handle it
> 
> \starttext
> […]

Thanks  a  lot. But  I'm  still  a  bit  lost in  all  the
new  commands. I  can't figure  out  how to  shade from  a
particular colour to transparent.

\starttext
\definecolor [trans-t] [t=1, a=normal]
\startMPpage

path p; p:=fullsquare scaled 5cm;
fill p withcolor \MPcolor{red};

% Works if background colour is known and uniform
path p; p:=fullsquare scaled 3cm;
fill p
  withshading("linear", llcorner p, urcorner p)
  withcolor \MPcolor{blue} shadedinto \MPcolor{red};

path p; p:=fullsquare scaled 5cm shifted (5cm, 0cm);
fill p withcolor \MPcolor{red};

% Shades to white
path p; p:=fullsquare scaled 3cm shifted (5cm, 0cm);
fill p
  withshading("linear", llcorner p, urcorner p)
  withfromshadecolor \MPcolor{blue} withtoshadecolor \MPcolor{trans-t};

\stopMPpage
\stoptext

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
___________________________________________________________________________________

  reply	other threads:[~2011-05-19 10:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-18 16:24 shading Hans Hagen
2011-05-18 18:30 ` shading Marco
2011-05-18 18:55   ` shading Henning Hraban Ramm
2011-05-18 19:25     ` shading Hans Hagen
2011-05-18 19:18   ` shading Hans Hagen
2011-05-18 20:24   ` shading Hans Hagen
2011-05-19 10:08     ` Marco [this message]
2011-05-19 10:55       ` shading Hans Hagen
2011-05-19 12:22         ` shading Marco
2020-02-25 11:34 Shading Fabrice Couvreur
2020-02-25 16:18 ` Shading Wolfgang Schuster
2020-02-26 10:34   ` Shading Fabrice Couvreur

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110519120852.58e85a36@glyph \
    --to=netuse@lavabit.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).