ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* metapost: shading and transparency
@ 2010-06-17 17:01 Marco
  2010-06-18  7:19 ` Taco Hoekwater
  0 siblings, 1 reply; 10+ messages in thread
From: Marco @ 2010-06-17 17:01 UTC (permalink / raw)
  To: ntg-context

Hi,

while using shading in metapost I cannot get transparency work.
The transparency is simply ignored and the result is the same colour as with
no transparency specified.

Here's an example that demonstrates the problem:

\definecolor [a]  [darkyellow]
\definecolor [b]  [r=1,  g=1,  b=1, a=1, t=0]
\definecolor [c]  [r=1,  g=1,  b=1, a=1, t=.5]
\definecolor [bg] [r=.8, g=.8, b=1]

% Define test background to see transparency (not) working
\defineoverlay[bg][\uniqueMPgraphic{bg}]
\startuniqueMPgraphic {bg}
  fill unitsquare
    xyscaled (\overlaywidth, \overlayheight) withcolor \MPcolor{bg};
    picture pic; pic := nullpicture;
    addto pic contour fullcircle scaled .5mm withcolor .2white;
    for i=1 upto 52:
      for j=1 upto 73:
	addto currentpicture also pic shifted (4mm*i, 4mm*j);
      endfor;
    endfor;
\stopuniqueMPgraphic
\setupbackgrounds [page] [background=bg]

\starttext
\startMPcode
  path p[];
  p1 := unitsquare xyscaled (4cm, 2cm);
  p2 := p1 yshifted -2.5cm;
  p3 := p2 yshifted -2.5cm;

  % Transparency does not work, background is white instead of full alpha
  linear_shade(p1,0,\MPcolor{a},\MPcolor{b});

  % Setting 2nd colour to background colour works only with plain coloured
  % backgrounds not with patterns
  linear_shade(p2,0,\MPcolor{a},\MPcolor{bg});

  % Transparency with simple »fill« works as expected
  fill p3 withcolor \MPcolor{c};
\stopMPcode
\stoptext

Thanks for any hints
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] 10+ messages in thread

* Re: metapost: shading and transparency
  2010-06-17 17:01 metapost: shading and transparency Marco
@ 2010-06-18  7:19 ` Taco Hoekwater
  2010-06-18  7:39   ` Mojca Miklavec
  0 siblings, 1 reply; 10+ messages in thread
From: Taco Hoekwater @ 2010-06-18  7:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Marco wrote:
> Hi,
> 
> while using shading in metapost I cannot get transparency work.
> The transparency is simply ignored and the result is the same colour as with
> no transparency specified.

Same here, but I am not sure whether this is a bug or an undocumented
limitation.

Best wishes,
Taco
___________________________________________________________________________________
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] 10+ messages in thread

* Re: metapost: shading and transparency
  2010-06-18  7:19 ` Taco Hoekwater
@ 2010-06-18  7:39   ` Mojca Miklavec
  2010-06-18  8:43     ` Hans Hagen
  2010-06-18  9:13     ` Mojca Miklavec
  0 siblings, 2 replies; 10+ messages in thread
From: Mojca Miklavec @ 2010-06-18  7:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, Jun 18, 2010 at 09:19, Taco Hoekwater wrote:
> Marco wrote:
>>
>> while using shading in metapost I cannot get transparency work.
>> The transparency is simply ignored and the result is the same colour as
>> with
>> no transparency specified.
>
> Same here, but I am not sure whether this is a bug or an undocumented
> limitation.

From what I understand/remember, combining transparency and shading
needs special treatment that hasn't been implemented. At least not
yet.

Mojca
___________________________________________________________________________________
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] 10+ messages in thread

* Re: metapost: shading and transparency
  2010-06-18  7:39   ` Mojca Miklavec
@ 2010-06-18  8:43     ` Hans Hagen
  2010-06-18  9:13     ` Mojca Miklavec
  1 sibling, 0 replies; 10+ messages in thread
From: Hans Hagen @ 2010-06-18  8:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Mojca Miklavec

On 18-6-2010 9:39, Mojca Miklavec wrote:
> On Fri, Jun 18, 2010 at 09:19, Taco Hoekwater wrote:
>> Marco wrote:
>>>
>>> while using shading in metapost I cannot get transparency work.
>>> The transparency is simply ignored and the result is the same colour as
>>> with
>>> no transparency specified.
>>
>> Same here, but I am not sure whether this is a bug or an undocumented
>> limitation.
>
>  From what I understand/remember, combining transparency and shading
> needs special treatment that hasn't been implemented. At least not
> yet.

indeed

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


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

* Re: metapost: shading and transparency
  2010-06-18  7:39   ` Mojca Miklavec
  2010-06-18  8:43     ` Hans Hagen
@ 2010-06-18  9:13     ` Mojca Miklavec
  2010-06-18  9:38       ` Hans Hagen
  2010-06-18 11:47       ` Marco
  1 sibling, 2 replies; 10+ messages in thread
From: Mojca Miklavec @ 2010-06-18  9:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, Jun 18, 2010 at 09:39, Mojca Miklavec wrote:
>
> From what I understand/remember, combining transparency and shading
> needs special treatment that hasn't been implemented. At least not
> yet.

... but it may work in TikZ (I would not bet that though) ...

Mojca
___________________________________________________________________________________
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] 10+ messages in thread

* Re: metapost: shading and transparency
  2010-06-18  9:13     ` Mojca Miklavec
@ 2010-06-18  9:38       ` Hans Hagen
  2010-06-18 11:48         ` Marco
  2010-06-18 11:47       ` Marco
  1 sibling, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2010-06-18  9:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Mojca Miklavec

On 18-6-2010 11:13, Mojca Miklavec wrote:
> On Fri, Jun 18, 2010 at 09:39, Mojca Miklavec wrote:
>>
>>  From what I understand/remember, combining transparency and shading
>> needs special treatment that hasn't been implemented. At least not
>> yet.
>
> .... but it may work in TikZ (I would not bet that though) ...

i just need to support combined mp tricks and so far i didn't need it

Hans

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


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

* Re: metapost: shading and transparency
  2010-06-18  9:13     ` Mojca Miklavec
  2010-06-18  9:38       ` Hans Hagen
@ 2010-06-18 11:47       ` Marco
  1 sibling, 0 replies; 10+ messages in thread
From: Marco @ 2010-06-18 11:47 UTC (permalink / raw)
  To: ntg-context

> > From what I understand/remember, combining transparency and shading
> > needs special treatment that hasn't been implemented. At least not
> > yet.
> 
> ... but it may work in TikZ (I would not bet that though) ...
Thanks for the tip. I haven't used it before.

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] 10+ messages in thread

* Re: metapost: shading and transparency
  2010-06-18  9:38       ` Hans Hagen
@ 2010-06-18 11:48         ` Marco
  2010-06-18 19:56           ` Hans Hagen
  0 siblings, 1 reply; 10+ messages in thread
From: Marco @ 2010-06-18 11:48 UTC (permalink / raw)
  To: ntg-context

On Fri, 18 Jun 2010 11:38:15 +0200, Hans Hagen <pragma@wxs.nl> wrote:

> On 18-6-2010 11:13, Mojca Miklavec wrote:
> > On Fri, Jun 18, 2010 at 09:39, Mojca Miklavec wrote:
> >>
> >>  From what I understand/remember, combining transparency and
> >> shading needs special treatment that hasn't been implemented. At
> >> least not yet.
> >
> > .... but it may work in TikZ (I would not bet that though) ...
> 
> i just need to support combined mp tricks and so far i didn't need it
    ^^^^
I like the »just«! Does that mean it's easy/quickly to do? This feature
would be very nice to have. It would make shading much more usable. :-)


Thanks for the quick reply
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] 10+ messages in thread

* Re: metapost: shading and transparency
  2010-06-18 11:48         ` Marco
@ 2010-06-18 19:56           ` Hans Hagen
  2010-06-19  4:30             ` Marco
  0 siblings, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2010-06-18 19:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Marco

On 18-6-2010 1:48, Marco wrote:
> On Fri, 18 Jun 2010 11:38:15 +0200, Hans Hagen<pragma@wxs.nl>  wrote:
>
>> On 18-6-2010 11:13, Mojca Miklavec wrote:
>>> On Fri, Jun 18, 2010 at 09:39, Mojca Miklavec wrote:
>>>>
>>>>    From what I understand/remember, combining transparency and
>>>> shading needs special treatment that hasn't been implemented. At
>>>> least not yet.
>>>
>>> .... but it may work in TikZ (I would not bet that though) ...
>>
>> i just need to support combined mp tricks and so far i didn't need it
>      ^^^^
> I like the »just«! Does that mean it's easy/quickly to do? This feature
> would be very nice to have. It would make shading much more usable. :-)

well, most things are rather 'just' but many of them accumulate

Hans


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

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

* Re: metapost: shading and transparency
  2010-06-18 19:56           ` Hans Hagen
@ 2010-06-19  4:30             ` Marco
  0 siblings, 0 replies; 10+ messages in thread
From: Marco @ 2010-06-19  4:30 UTC (permalink / raw)
  To: ntg-context

On Fri, 18 Jun 2010 21:56:53 +0200, Hans Hagen <pragma@wxs.nl> wrote:

> >> i just need to support combined mp tricks and so far i didn't need
> >> it
> >      ^^^^
> > I like the »just«! Does that mean it's easy/quickly to do? This
> > feature would be very nice to have. It would make shading much more
> > usable. :-)
> 
> well, most things are rather 'just' but many of them accumulate
That's true. However I hope you'll find the spirit to implement this
feature.

Kind regards
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] 10+ messages in thread

end of thread, other threads:[~2010-06-19  4:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-17 17:01 metapost: shading and transparency Marco
2010-06-18  7:19 ` Taco Hoekwater
2010-06-18  7:39   ` Mojca Miklavec
2010-06-18  8:43     ` Hans Hagen
2010-06-18  9:13     ` Mojca Miklavec
2010-06-18  9:38       ` Hans Hagen
2010-06-18 11:48         ` Marco
2010-06-18 19:56           ` Hans Hagen
2010-06-19  4:30             ` Marco
2010-06-18 11:47       ` Marco

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).