<font color='black' size='2' face='arial'><br>
Hi Adrian,<br>
<br>
Thanks for your example code. It works good. The ring_gradient.c is similar to what I tested using Bezier curves with meshes<font size="2"> so I am close</font>. Both Bezier curve meshes and trapezoid meshes will work to draw a ring gradient. Still stuck with the problem of starting and stopping a gradient in an arc at discrete points in the arc. I haven't figured out how to "sweep" a gradient color through a ring arc in a smooth fashion. That would make a gauge<font size="2"> widget</font> a little more adjustable<font size="2"> wirh a standardized scale</font>.<br>
<br>
Eric<br>
<br>
<div> <br>
</div>
<div> <br>
</div>
<div> <br>
</div>
<div style="font-family:arial,helvetica;font-size:10pt;color:black">-----Original Message-----<br>
From: Adrian Johnson <ajohnson@redneon.com><br>
To: cecashon <cecashon@aol.com>; cairo <cairo@cairographics.org><br>
Sent: Wed, May 10, 2017 3:11 pm<br>
Subject: Re: [cairo] Circular Ring Gradient<br>
<br>
On 11/05/17 07:20, Adrian Johnson wrote:<br>
> On 11/05/17 06:27, <a removedlink__4d56dd72-487f-450d-a4ea-c3edfff99c92__href="mailto:cecashon@aol.com">cecashon@aol.com</a> wrote:<br>
>> Hi Cairo folks,<br>
>><br>
>> What is the best way to make a circular gradient in a ring? I have tried<br>
>> using both a Bezier approximation to a circle and just using trapezoids.<br>
>> The trapezoids work fine if I have 16 of them and then clip the ring. A<br>
>> little problem with not having continuous values in a ring so if I cut<br>
>> the ring at a particular location it has to be at the end of a trapezoid<br>
>> section if I want the gradient to fill to the end. Otherwise it looks to<br>
>> work well. Think there might be an easier way to do this though so I am<br>
>> asking about it. Has anyone had good success drawing circular gradients<br>
>> in a ring? I am looking to be able to add some Cairo gradients to a<br>
>> gauge widget so efficiency would be a good thing if the gauge needed to<br>
>> work with a frame clock.<br>
> <br>
> Mesh patches can have Bézier curved sides. A circle can be approximated<br>
> with 8 Bézier curves. A ring can be created with 8 patches. See attached<br>
> example and output.<br>
<br>
I attached the executable instead of the code. Here is the code.<br>
<br>
<br>
<br>
<br>
</div>
</font>