Path: csiph.com!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Helge Blischke Newsgroups: comp.lang.postscript Subject: Re: setrgbcolor with lineto/curveto Followup-To: comp.lang.postscript Date: Wed, 13 Jun 2012 16:16:37 +0200 Lines: 20 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit X-Trace: individual.net TpnjpzAi2Gu5Ky/AOFF0UQA3x/E/w8yqd5lNrayMOoqv4Q2T4HTCd8BmZ20CYWuE3y Cancel-Lock: sha1:/crqBSIPxVguof8GCymCenSti5U= User-Agent: KNode/0.99.01 Xref: csiph.com comp.lang.postscript:738 JohnF wrote: > Apologies if this is simple, but I don't know postscript > very well, and failed to google it... > I'd like to draw a lineto/curveto with the color varying > from one endpoint to the other. That is, it should start > with a b c setrgbcolor at one endpoint and end up with > a' b' c' setrgbcolor at the other end. It's decorative, > so a-->a', b-->b', c-->c' can vary linearly, or anything > like that, along the line's length. Thanks, You will have to (1) encapsulate your path to be drawn into gsave and grestore to prevent unwanted side effects and (2) define a shading pattern and then do the stroke. For the details see the PLRM (Postscript Language Reference Manual). Note that shading is a level3 feature. Helge