ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Shading transparency / missing linear_shade variant
@ 2004-07-23 12:07 Eckhart Guthöhrlein
  2004-07-24  9:36 ` Vit Zyka
  0 siblings, 1 reply; 6+ messages in thread
From: Eckhart Guthöhrlein @ 2004-07-23 12:07 UTC (permalink / raw)


Hi all,

experimenting with transparencies, I have obviously come to a
limitation: color shading does not work for transparent colors. What I
have in mind is a bar filled with a color gradient, starting from a
certain (non-transparent) color and ending transparent, i.e. vanishing
into the background. However, the transparent color appears just black.

Furthermore, the shading variants for linear_shade do not correspond
with those listed in the metafun manual, page 180. Variant 2 is missing
and behaves like variant 3 should.

Example:

\setupcolors[state=start]
\setupbackgrounds[page][background=color,backgroundcolor=red]

\startMPenvironment[global]
	\definecolor[HeadLineColor][r=0,g=0,b=1]
  \definecolor[Transparent][r=1,g=1,b=1,t=0,a=normal]
\stopMPenvironment

\startreusableMPgraphic{test}
	numeric u; u=3cm;
	path p;
	p := unitsquare xscaled u yscaled u cornered (u/10);
	for i=0 upto 3 :
		linear_shade(p shifted(i*u,0),i,\MPcolor{HeadLineColor},\MPcolor{Transparent});
	endfor;	
\stopreusableMPgraphic

\starttext
	\reuseMPgraphic{test}
\stoptext

-- 
Eckhart

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

* Re: Shading transparency / missing linear_shade variant
  2004-07-23 12:07 Shading transparency / missing linear_shade variant Eckhart Guthöhrlein
@ 2004-07-24  9:36 ` Vit Zyka
  2004-07-27 11:18   ` Eckhart Guthöhrlein
  0 siblings, 1 reply; 6+ messages in thread
From: Vit Zyka @ 2004-07-24  9:36 UTC (permalink / raw)


> Furthermore, the shading variants for linear_shade do not correspond
> with those listed in the metafun manual, page 180. Variant 2 is missing
> and behaves like variant 3 should.

Not so exactly. The today reality is a bit richer than that in the 
Metafun manual. One can choose from 8 directions:

number   direction
1        NE
2        NW
3        SW
4        SE
5        E
6        N
7        W
8        S
other    E

Vit Zyka

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

* Re: Shading transparency / missing linear_shade variant
  2004-07-24  9:36 ` Vit Zyka
@ 2004-07-27 11:18   ` Eckhart Guthöhrlein
  2004-07-27 11:37     ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Eckhart Guthöhrlein @ 2004-07-27 11:18 UTC (permalink / raw)


On Sat, Jul 24, 2004 at 11:36:03AM +0200, Vit Zyka wrote:
> >Furthermore, the shading variants for linear_shade do not correspond
> >with those listed in the metafun manual, page 180. Variant 2 is missing
> >and behaves like variant 3 should.
> 
> Not so exactly. The today reality is a bit richer than that in the 
> Metafun manual. One can choose from 8 directions:
> 
> number   direction
> 1        NE
> 2        NW
> 3        SW
> 4        SE
> 5        E
> 6        N
> 7        W
> 8        S
> other    E

All right, thanks. Admittedly, i could have found this by trying more
numbers.
But anyway, transparency is ignored when using shading. Is there any
possibility to achieve a gradient from, i.e., completely transparent to
completely intransparent white?

-- 
Eckhart

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

* Re: Shading transparency / missing linear_shade variant
  2004-07-27 11:18   ` Eckhart Guthöhrlein
@ 2004-07-27 11:37     ` Hans Hagen
  2004-07-27 11:45       ` Eckhart Guthöhrlein
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2004-07-27 11:37 UTC (permalink / raw)


Eckhart Guthöhrlein wrote:

>On Sat, Jul 24, 2004 at 11:36:03AM +0200, Vit Zyka wrote:
>  
>
>>>Furthermore, the shading variants for linear_shade do not correspond
>>>with those listed in the metafun manual, page 180. Variant 2 is missing
>>>and behaves like variant 3 should.
>>>      
>>>
>>Not so exactly. The today reality is a bit richer than that in the 
>>Metafun manual. One can choose from 8 directions:
>>
>>number   direction
>>1        NE
>>2        NW
>>3        SW
>>4        SE
>>5        E
>>6        N
>>7        W
>>8        S
>>other    E
>>    
>>
>
>All right, thanks. Admittedly, i could have found this by trying more
>numbers.
>But anyway, transparency is ignored when using shading. Is there any
>possibility to achieve a gradient from, i.e., completely transparent to
>completely intransparent white?
>  
>
no(t yet), i dunno if pdf supports that -) 

Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

* Re: Shading transparency / missing linear_shade variant
  2004-07-27 11:37     ` Hans Hagen
@ 2004-07-27 11:45       ` Eckhart Guthöhrlein
  2004-07-27 12:14         ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Eckhart Guthöhrlein @ 2004-07-27 11:45 UTC (permalink / raw)


On Tue, Jul 27, 2004 at 01:37:06PM +0200, Hans Hagen wrote:
> >But anyway, transparency is ignored when using shading. Is there any
> >possibility to achieve a gradient from, i.e., completely transparent to
> >completely intransparent white?
> > 
> >
> no(t yet), i dunno if pdf supports that -) 

That's really a pity. But alas, if *you* don't know, it's probably
hopeless.

-- 
Eckhart

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

* Re: Shading transparency / missing linear_shade variant
  2004-07-27 11:45       ` Eckhart Guthöhrlein
@ 2004-07-27 12:14         ` Hans Hagen
  0 siblings, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2004-07-27 12:14 UTC (permalink / raw)


Eckhart Guthöhrlein wrote:

>On Tue, Jul 27, 2004 at 01:37:06PM +0200, Hans Hagen wrote:
>  
>
>>>But anyway, transparency is ignored when using shading. Is there any
>>>possibility to achieve a gradient from, i.e., completely transparent to
>>>completely intransparent white?
>>>
>>>
>>>      
>>>
>>no(t yet), i dunno if pdf supports that -) 
>>    
>>
>
>That's really a pity. But alas, if *you* don't know, it's probably
>hopeless.
>  
>
the problem is in the fact that in a shading one has to define a vector and i have to find out how to define a transparent vector (color 1 -> color 2) 

Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

end of thread, other threads:[~2004-07-27 12:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-23 12:07 Shading transparency / missing linear_shade variant Eckhart Guthöhrlein
2004-07-24  9:36 ` Vit Zyka
2004-07-27 11:18   ` Eckhart Guthöhrlein
2004-07-27 11:37     ` Hans Hagen
2004-07-27 11:45       ` Eckhart Guthöhrlein
2004-07-27 12:14         ` 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).