Re: [NTG-context] Shading

2020-02-26 Thread Fabrice Couvreur
Hi Wolfgang, I would like the same result as the code with TikZ. Thank you. Fabrice \usemodule[tikz] \starttext \startMPcode fill fullcircle xscaled 1cm yscaled 0.88cm shaded withshademethod "circular" withshadefactor 0.75 withshadecolors (white,red); \stopMPcode \starttikzpicture

Re: [NTG-context] Shading

2020-02-25 Thread Wolfgang Schuster
On Tue, 25 Feb 2020 12:34:00 +0100 Fabrice Couvreur wrote: > Hi, > In the Metafun documentation on page 410, there is a shaded bullet "fill > fullcircle shaded cshade". > I tried to reproduce the same effect, but it is not exactly the same result. It's different because your code isn't the same

Re: [NTG-context] Shading and transparency

2018-07-12 Thread Marco Patzer
On Thu, 12 Jul 2018 22:59:05 +0200 Hans Hagen wrote: > hm, I'm puzzled as a shade doesn't go between colors + transparent > but from one color to another (in the same color space) and > transparency is just a different mechanism > > maybe it was some side effect of chosen values / vectors that

Re: [NTG-context] Shading and transparency

2018-07-12 Thread Hans Hagen
On 7/12/2018 10:08 PM, Marco Patzer wrote: On Thu, 12 Jul 2018 11:21:45 +0200 Hans Hagen wrote: For the old implementation (pre 2016-ish) I had a working solution because shading to transparent colours just worked (at least in my case of a simple transparent shade, nothing fancy), but not so

Re: [NTG-context] Shading and transparency

2018-07-12 Thread Marco Patzer
On Thu, 12 Jul 2018 11:21:45 +0200 Hans Hagen wrote: > > For the old implementation (pre 2016-ish) I had a working solution > > because shading to transparent colours just worked (at least in my > > case of a simple transparent shade, nothing fancy), but not so any > > longer. With the new

Re: [NTG-context] Shading and transparency

2018-07-12 Thread Hans Hagen
On 7/11/2018 11:40 PM, Marco Patzer wrote: On Wed, 11 Jul 2018 23:11:31 +0200 Hans Hagen wrote: Is there a method that does not require an external file or pre-processing? Using the external file works. Just wondering if there's a better - more integrated - way. i guess that with some

Re: [NTG-context] Shading and transparency

2018-07-11 Thread Marco Patzer
On Wed, 11 Jul 2018 23:11:31 +0200 Hans Hagen wrote: > > Is there a method that does not require an external file or > > pre-processing? Using the external file works. Just wondering if > > there's a better - more integrated - way. > i guess that with some experimenting you can come close but

Re: [NTG-context] Shading and transparency

2018-07-11 Thread Hans Hagen
On 7/11/2018 8:45 PM, Marco Patzer wrote: Hi! It's shadings and transparency again. For most things transparency is not required since the background colour (white) can be used instead, to achieve the same effect (thanks Hans for the reimplementation/cleanup a while ago). For one use case I

Re: [NTG-context] Shading to transparent using withshademethod

2016-01-28 Thread Hans Hagen
On 1/28/2016 2:02 PM, Marco Patzer wrote: On Thu, 28 Jan 2016 12:29:46 +0100 Hans Hagen 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

Re: [NTG-context] Shading to transparent using withshademethod

2016-01-28 Thread Hans Hagen
On 1/28/2016 3:34 PM, Marco Patzer wrote: On Thu, 28 Jan 2016 14:45:13 +0100 Hans Hagen wrote: On 1/28/2016 1:53 PM, Marco Patzer wrote: On Thu, 28 Jan 2016 12:33:39 +0100 Hans Hagen wrote: How to make transparent shadings work with the new mechanism?

Re: [NTG-context] Shading to transparent using withshademethod

2016-01-28 Thread Marco Patzer
On Thu, 28 Jan 2016 18:26:28 +0100 Hans Hagen wrote: > On 1/28/2016 3:34 PM, Marco Patzer wrote: > > On Thu, 28 Jan 2016 14:45:13 +0100 > > Hans Hagen wrote: > > > >> On 1/28/2016 1:53 PM, Marco Patzer wrote: > >>> On Thu, 28 Jan 2016 12:33:39 +0100 > >>> Hans

Re: [NTG-context] Shading to transparent using withshademethod

2016-01-28 Thread Hans Hagen
On 1/27/2016 10:05 PM, Marco Patzer wrote: Hi, some months ago the withshading, withfromshadecolor etc. have apparently been replaced by the more general withshademethod, withshadevector, withshadecolors, etc. methods. I have issues converting the old withshading code to the withshademethod

Re: [NTG-context] Shading to transparent using withshademethod

2016-01-28 Thread Marco Patzer
On Thu, 28 Jan 2016 12:33:39 +0100 Hans Hagen wrote: > >>> How to make transparent shadings work with the new mechanism? > >> > >> withtransparency (1,.5) > > > > However, this makes the entire shade transparent. How to shade from > > one colour to transparent using

Re: [NTG-context] Shading to transparent using withshademethod

2016-01-28 Thread Marco Patzer
On Thu, 28 Jan 2016 12:29:46 +0100 Hans Hagen 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

Re: [NTG-context] Shading to transparent using withshademethod

2016-01-28 Thread Marco Patzer
On Thu, 28 Jan 2016 09:43:24 +0100 Hans Hagen wrote: > On 1/27/2016 10:05 PM, Marco Patzer wrote: > > The new code appears to work in general, but only if no shading to > > transparent is being used: > > > > \definecolor [trans] [a=multiply, t=.5, s=.5] > > \starttext > >

Re: [NTG-context] Shading to transparent using withshademethod

2016-01-28 Thread Hans Hagen
On 1/28/2016 9:43 AM, Hans Hagen wrote: On 1/27/2016 10:05 PM, Marco Patzer wrote: Hi, some months ago the withshading, withfromshadecolor etc. have apparently been replaced by the more general withshademethod, withshadevector, withshadecolors, etc. methods. I have issues converting the old

Re: [NTG-context] Shading to transparent using withshademethod

2016-01-28 Thread Hans Hagen
On 1/28/2016 11:45 AM, Marco Patzer wrote: On Thu, 28 Jan 2016 09:43:24 +0100 Hans Hagen wrote: On 1/27/2016 10:05 PM, Marco Patzer wrote: The new code appears to work in general, but only if no shading to transparent is being used: \definecolor [trans] [a=multiply, t=.5,

Re: [NTG-context] Shading to transparent using withshademethod

2016-01-28 Thread Marco Patzer
On Thu, 28 Jan 2016 14:45:13 +0100 Hans Hagen wrote: > On 1/28/2016 1:53 PM, Marco Patzer wrote: > > On Thu, 28 Jan 2016 12:33:39 +0100 > > Hans Hagen wrote: > > > > How to make transparent shadings work with the new mechanism? > >

Re: [NTG-context] Shading to transparent using withshademethod

2016-01-28 Thread Hans Hagen
On 1/28/2016 1:53 PM, Marco Patzer wrote: On Thu, 28 Jan 2016 12:33:39 +0100 Hans Hagen wrote: How to make transparent shadings work with the new mechanism? withtransparency (1,.5) However, this makes the entire shade transparent. How to shade from one colour to

Re: [NTG-context] shading

2011-05-19 Thread Marco
On 2011-05-18 Hans Hagen pra...@wxs.nl wrote: On 18-5-2011 8:30, Marco wrote: % Error % path p; p:=fullsquare scaled 5cm shifted (10cm, 0cm); % fill p % withshading(linear, llcorner p, urcorner p) % withcolor \MPcolor{red-t} shadedinto \MPcolor{blue}; don't ask how, but the

Re: [NTG-context] shading

2011-05-19 Thread Hans Hagen
On 19-5-2011 12:08, Marco wrote: new commands. I can't figure out how to shade from a particular colour to transparent. afaik you can't as one shades from color to color (maybe choosing another transparency method) Hans

Re: [NTG-context] shading

2011-05-19 Thread Marco
On 2011-05-19 Hans Hagen pra...@wxs.nl wrote: On 19-5-2011 12:08, Marco wrote: new commands. I can't figure out how to shade from a particular colour to transparent. afaik you can't as one shades from color to color (maybe achoosing nother transparency method) As soon as

Re: [NTG-context] shading

2011-05-18 Thread Marco
For this metafun has been extended with a few more shading commands, with the nicest being: […] Very nice these commands! I like them. But the shadings in MP still have problems with transparency. Example below. I guess, it's not supported. If not, are you planing to add

Re: [NTG-context] shading

2011-05-18 Thread Henning Hraban Ramm
Am 2011-05-18 um 20:30 schrieb Marco: For this metafun has been extended with a few more shading commands, with the nicest being: […] Very nice these commands! I like them. But the shadings in MP still have problems with transparency. Example below. I guess, it's not

Re: [NTG-context] shading

2011-05-18 Thread Hans Hagen
On 18-5-2011 8:30, Marco wrote: % The entire square is transparent, % not just the shading part path p; p:=fullsquare scaled 5cm shifted (5cm, 0cm); fill p withshading(linear, llcorner p, urcorner p) withcolor \MPcolor{red} shadedinto \MPcolor{blue-t}; indeed, as transparency is

Re: [NTG-context] shading

2011-05-18 Thread Hans Hagen
On 18-5-2011 8:55, Henning Hraban Ramm wrote: Am 2011-05-18 um 20:30 schrieb Marco: For this metafun has been extended with a few more shading commands, with the nicest being: […] Very nice these commands! I like them. But the shadings in MP still have problems with transparency. Example

Re: [NTG-context] shading

2011-05-18 Thread Hans Hagen
On 18-5-2011 8:30, Marco wrote: % Error % path p; p:=fullsquare scaled 5cm shifted (10cm, 0cm); % fill p % withshading(linear, llcorner p, urcorner p) % withcolor \MPcolor{red-t} shadedinto \MPcolor{blue}; don't ask how, but the upcoming beta can handle it \starttext \definecolor

Re: [NTG-context] shading in metapost

2008-01-24 Thread Thomas A. Schmitz
On Jan 16, 2008, at 11:22 PM, John Luciani wrote: There is some information on doing transparencies in METAPOST at http://www-math.univ-poitiers.fr/~phan/metalpha.html Using the code at the above link you should be able to produce the effect in your jpeg. (* jcl *) John, I never thanked

Re: [NTG-context] shading in metapost

2008-01-24 Thread Aditya Mahajan
Hi Thomas, On Thu, 24 Jan 2008, Thomas A. Schmitz wrote: On Jan 24, 2008, at 1:28 AM, Mojca Miklavec wrote: In theory possible, but in practice not implemented in metafun. But see http://www.fauskes.net/media/pgf/pgfmanualCVS2008-01-23.pdf It might satisfy your needs. (Impressive!)

Re: [NTG-context] shading in metapost

2008-01-24 Thread Thomas A. Schmitz
On Jan 24, 2008, at 9:03 AM, Aditya Mahajan wrote: Hi Thomas, On Thu, 24 Jan 2008, Thomas A. Schmitz wrote: I wanted to be clever and do it in a for-loop like this: for i=1 upto 10: pickup pencircle scaled (i*0.5) pt ; draw fullcircle scaled 5mm withcolor transparent

Re: [NTG-context] shading in metapost

2008-01-24 Thread Hans Hagen
Thomas A. Schmitz wrote: I never thanked you for your message; sorry about that! Unless I'm missing something, this page is just about transparency, but that works quite well in metafun; it was the combination of transparency and shading which I couldn't get right. in mkiv at some

Re: [NTG-context] shading in metapost

2008-01-23 Thread Mojca Miklavec
On Jan 16, 2008 8:07 PM, Thomas A. Schmitz wrote: Hi all, I have a somewhat silly question about metapost/metafun. To emphasize parts of a picture, I place a bright red arrow or circle/ellipse on top of the picture. I would like to make this arrow more visible by putting a shade beneath it

Re: [NTG-context] shading in metapost

2008-01-16 Thread John Luciani
There is some information on doing transparencies in METAPOST at http://www-math.univ-poitiers.fr/~phan/metalpha.html Using the code at the above link you should be able to produce the effect in your jpeg. (* jcl *) -- http://www.luciani.org

Re: [NTG-context] shading with stitching functions

2006-12-27 Thread Hans Hagen
Mojca Miklavec wrote: Hello, I'm still trying to get shading in MetaPost as the one in the attached eps file, but I don't manage to decipher the way how other shandings are done. There's a .tex file attached with a failed (hardcoded) example tries but I don't know where to explore

Re: [NTG-context] shading with stitching functions

2006-12-27 Thread Peter Rolf
Hi Mojca, this is also on my wishlist (and christmas is over). Currently I use several color gradients in a row, to simulate the same effect. But sadly this way is too viewer dependent (rendering is a matter of luck with every new version), not to mention the big size. So if there would be a

Re: [NTG-context] shading with stitching functions

2006-12-27 Thread Mojca Miklavec
On 12/27/06, Peter Rolf wrote: Hi Mojca, this is also on my wishlist (and christmas is over). Currently I use several color gradients in a row, to simulate the same effect. But sadly this way is too viewer dependent (rendering is a matter of luck with every new version), not to mention the

Re: [NTG-context] shading with stitching functions

2006-12-27 Thread Peter Rolf
Mojca Miklavec wrote: On 12/27/06, Peter Rolf wrote: Hi Mojca, this is also on my wishlist (and christmas is over). Currently I use several color gradients in a row, to simulate the same effect. But sadly this way is too viewer dependent (rendering is a matter of luck with every new

Re: [NTG-context] shading box many times

2005-11-29 Thread Hans Hagen
Vit Zyka wrote: Hans Hagen wrote: Taco Hoekwater wrote: Hans Hagen wrote: Vit Zyka wrote: Dear Metafun Wizards, I have noticed some strange behaviour with box shading. It works OK until some number of shadings. Please see example: http://typokvitek.com/tmp/shade-many.pdf Any idea

Re: [NTG-context] shading box many times

2005-11-28 Thread Hans Hagen
Vit Zyka wrote: Dear Metafun Wizards, I have noticed some strange behaviour with box shading. It works OK until some number of shadings. Please see example: http://typokvitek.com/tmp/shade-many.pdf Any idea for solving? Next not-minimal but small and illustrative example can help. works

Re: [NTG-context] shading box many times

2005-11-28 Thread Vit Zyka
Hans Hagen wrote: Vit Zyka wrote: Dear Metafun Wizards, I have noticed some strange behaviour with box shading. It works OK until some number of shadings. Please see example: http://typokvitek.com/tmp/shade-many.pdf Any idea for solving? Next not-minimal but small and illustrative

Re: [NTG-context] shading box many times

2005-11-28 Thread Taco Hoekwater
Hans Hagen wrote: it's related to the fact that there can be 1000 specials only (this /1000 in mp-spec) Why? if you add: \def\MPrgbnumber#1{\expandafter\doMPrgbnumber#1.0\relax} \def\doMPrgbnumber#1.#2#3#4#5#6\relax{#2#3#4#5} \startMPinclusions _special_div_ := 1 ;

Re: [NTG-context] shading box many times

2005-11-28 Thread Hans Hagen
Taco Hoekwater wrote: Whether or not that makes dividing by 10.000 safe is not clear to me. I have to read up on what is going on first. for i=1 upto 1 : show i/1 ; endfor ; indicates that indeed the precision is ok i put a version for testing purposes at

Re: [NTG-context] shading box many times

2005-11-28 Thread Peter Rolf
Vit Zyka wrote: Taco Hoekwater wrote: Hans Hagen wrote: Vit Zyka wrote: Dear Metafun Wizards, I have noticed some strange behaviour with box shading. It works OK until some number of shadings. Please see example: http://typokvitek.com/tmp/shade-many.pdf Any idea for solving? Next

Re: [NTG-context] shading box many times

2005-11-28 Thread Vit Zyka
Hans Hagen wrote: Taco Hoekwater wrote: Hans Hagen wrote: Vit Zyka wrote: Dear Metafun Wizards, I have noticed some strange behaviour with box shading. It works OK until some number of shadings. Please see example: http://typokvitek.com/tmp/shade-many.pdf Any idea for solving? Next

Re: [NTG-context] shading in meta[post/play] PDF

2005-01-21 Thread h h extern
Mojca Miklavec wrote: Problem description: I have a computer program, which carries the data about the grid points on a sphere (possibly with different colors defined in these points) and how the points are connected with each other to form a grid. I would take these triangles (or

Re: [NTG-context] shading in meta[post/play] PDF

2005-01-20 Thread Mojca Miklavec
Hans Hagen wrote: Mojca Miklavec wrote: How can I make shading inside metapost(play) to produce exactly what's in the attached picture (smooth shades). Or more generally: how can I hardcode some PS/PDF code in .mp, not (yet) supported by metapost(play)? certain kind of native level 2 shaded

Re: [NTG-context] Shading transparency / missing linear_shade variant

2004-07-27 Thread Eckhart Guthöhrlein
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

Re: [NTG-context] Shading transparency / missing linear_shade variant

2004-07-27 Thread Hans Hagen
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

Re: [NTG-context] Shading transparency / missing linear_shade variant

2004-07-27 Thread Eckhart Guthöhrlein
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

Re: [NTG-context] Shading transparency / missing linear_shade variant

2004-07-27 Thread Hans Hagen
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

Re: [NTG-context] Shading transparency / missing linear_shade variant

2004-07-24 Thread Vit Zyka
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: