ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: ntg-context@ntg.nl
Subject: Re: Shading to transparent using withshademethod
Date: Thu, 28 Jan 2016 16:16:23 +0100	[thread overview]
Message-ID: <56AA30C7.6040902@wxs.nl> (raw)
In-Reply-To: <20160128140246.1e3fa6f2@homerow>

On 1/28/2016 2:02 PM, Marco Patzer wrote:
> On Thu, 28 Jan 2016 12:29:46 +0100
> Hans Hagen <pragma@wxs.nl> wrote:
>
>>>> How to make transparent shadings work with the new mechanism?
>>>
>>>         withtransparency (1,.5)
>>
>> next beta
>>
>> \definecolor [trans] [a=multiply, t=.5, g=.5]
>>
>> \startMPpage
>>       fill fullcircle scaled 12cm withcolor \MPcoloronly{trans};
>>       fill fullcircle scaled 10cm withcolor \MPcolor{trans};
>>
>>       fill fullsquare xyscaled (15cm, 15cm)
>>         withshademethod "linear"
>>         withshadevector (0,1)
>>         withshadecolors (red,\MPcoloronly{trans})
>>         withtransparency \MPtransparency{trans}
>>       ;
>>
>> \stopMPpage
>
> I believe the \MPcoloronly and \MPtransparency macros split up the
> \MPcolor in it's colour and transparency parts.
>
> This doesn't really provide a solution to the initial problem as I
> understand. Rather it seems to be a more robust way to use
> transparency and prevent choking on colours that might contain
> transparent parts.

In the old method we used special mp colors to store all kind of things 
which wasn't 100% robust either (because some colors were not possible 
then). Even then internally color and transparency had to be split in 
mp. The new syntax for shading is extensible.

You really don't want to know how extensions like shading and tex text 
and ... were implemented in mkii metapost.

> I will shade to the background colour then, which is not that clean
> but works as well. Anyway, thanks for the quick answer and the
> clarification.

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

      reply	other threads:[~2016-01-28 15:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-27 21:05 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 message]

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=56AA30C7.6040902@wxs.nl \
    --to=pragma@wxs.nl \
    --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).