Shading transparency / missing linear_shade variant
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
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
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
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 -----------------------------------------------------------------
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
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 -----------------------------------------------------------------
participants (3)
-
Eckhart Guthöhrlein
-
Hans Hagen
-
Vit Zyka