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

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