Re: Gradient
Otfried Cheong <[email protected]> Wed, 23 Nov 2016 20:48:41 +0100
| Newsgroups | gmane.comp.graphics.ipe.general |
|---|---|
| Message-ID | <1479930521.4076244.797366137.695B1922@webmail.messagingengine.com> |
If you do not want to edit stylesheets directly, currently the only way to create gradients is using the Ipelet posted on this list a while ago (http://lists.science.uu.nl/pipermail/ipe-discuss/2015-July/001646.html). The actual ipelet is here: http://lists.science.uu.nl/pipermail/ipe-discuss/attachments/20150707/b31d5a50/attachment.obj Save it as "gradients.lua" into your ipelet directory. Cheers, Otfried On Wed, Nov 23, 2016, at 19:36, Roberto D wrote: > Thank you for your kind answer. Just another question. In order to write > the commands you say, you would suggest to draw a rectangle and the "Edit > as xml" in order to apply the gradient definition? > Sorry, but I usually use IPE interactively and not using line commands, > so > I am a little bit confused. > Best regards > Roberto > > 2016-11-22 22:21 GMT+01:00 Otfried Cheong <[email protected]>: > > > In the current Ipe version, the gradient coordinates apply to the object > > coordinates without the matrix. For instance, if you draw this > > rectangle: > > <path layer="alpha" fill="1" gradient="linear"> > > 128 640 m > > 128 576 l > > 256 576 l > > 256 640 l > > h > > </path> > > > > then you can apply a gradient to it by using the same coordinates: > > <gradient name="linear" type="axial" coords="128 0 256 0" extend="yes"> > > <stop offset="0" color="1 0.4 0"/> > > <stop offset="0.05" color="1 0.4 0"/> > > <stop offset="0.95" color="1 1 0.4"/> > > <stop offset="1" color="1 1 0.4"/> > > </gradient> > > > > When you move the rectangle from the Ipe user interface, this will > > change only the matrix of the object, and so it still has the correct > > gradient: > > > > <path layer="alpha" matrix="1 0 0 1 288 96" fill="1" gradient="linear"> > > 128 640 m > > 128 576 l > > 256 576 l > > 256 640 l > > h > > </path> > > > > However, if you edit the object or perform some other operation that > > will change the coordinates of the rectangle, it will stop to work > > correctly. > > > > In the next version, I plan to simplify the use of gradients by making > > it possible to write gradient coordinates that ALWAYS apply to the > > object. My current idea is that 0,0 would be the bottom left corner, > > 100, 100 the top right corner of the objects bounding box. > > > > Cheers, > > Otfried > > > > > > On Tue, Nov 22, 2016, at 22:11, Roberto D wrote: > > > Hi everybody, > > > I am not an expert about IPE. > > > Please look at the linear gradient example here > > > http://ipe.otfried.org/manual/manual_32.html, that is the following > > lines > > > <gradient name="linear" type="axial" extend="yes" coords="75 0 325 0"> > > > <stop offset="0.05" color="1 0.4 0"/> > > > <stop offset="0.95" color="1 1 0.4"/> > > > </gradient> > > > > > > My question is the following. Is it possible to modify the lines above so > > > that the coordinates become the local coordinates of the rectangle (that > > > is > > > attached to the object, wherever I draw it in the plane)? > > > I cannot figure out how to use the matrix option. > > > Thank you > > > Roberto > > > _______________________________________________ > > > Ipe-discuss mailing list > > > Ipe-discuss-rGrgPyRx506NN8uzcEdRPYRWq/[email protected] > > > http://lists.science.uu.nl/mailman/listinfo/ipe-discuss > > _______________________________________________ > > Ipe-discuss mailing list > > Ipe-discuss-rGrgPyRx506NN8uzcEdRPYRWq/[email protected] > > http://lists.science.uu.nl/mailman/listinfo/ipe-discuss > >