[Ipe-discuss] Gradient

Otfried Cheong otfried at ipe.airpost.net
Tue Nov 22 22:21:38 CET 2016


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 at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/ipe-discuss


More information about the Ipe-discuss mailing list