# About current gradients (Re: minutes, SVG WG Seattle F2F 2011 day 3)

From: Cyril Concolato <cyril.concolato@telecom-paristech.fr>
Date: Thu, 04 Aug 2011 17:36:32 +0200
Message-ID: <4E3ABC80.1060502@telecom-paristech.fr>

```Le 30/07/2011 07:38, Cameron McCormack a écrit :
> <trackbot> Created ACTION-3097 - Propose wording for the edge case
> where a radialGradient's focal point sits on the edge of the circle
> and the gradient repeats. the spec. should say that when the focal
> point is on the circle edge, with repeat, then the distance between
> the first and last stop for the repeating colors is 0 and the paint
> should generate a color that is the average of all the gradient
> stops. [on Erik Dahlström - due 2011-08-05].
I don't understand this action and the associated resolution.
Looking at the SVG 1.1 2nd Ed, and unless I missed some text, there's only a picture showing what it should look like. So it's not very clear how a gradient should be drawn:
b) outside the circle going from the focal point to the center and away
c) outside the circle going from the focal point opposite to the center.

For the inside of the gradient circle, I believe that the definition from the Canvas spec [1] is mathematically what SVG players do (except for the fr, see below). I think that definition would work also for pixels outside the gradient circle, but opposite of the focal point from the center (case b). For case, c) I don't think there's a defined behavior. We could decide to fill the rest with the last stop color or we could decide to flip the content with of the half-plane separated by the normal to the center-focal vector.

I've made two examples showing how the gradients are built. Have a look here:

>
> ed: canvas can define the inner circle that the radial gradient
> focuses on. SVG could/should align to that by adding an fr attribute
> to control the focal radius.
> ... fr would define where you would hav the zero offset for stops.
>
I believe it can already be done with the first stop color being equal to the second stop color, the second stop having a proper offset (computed from r1,r2,x1,x2,y1,y2), no?

Cyril
--
Cyril Concolato
Maître de Conférences/Associate Professor
Groupe Multimedia/Multimedia Group
Telecom ParisTech
46 rue Barrault
75 013 Paris, France
http://concolato.wp.institut-telecom.fr/
```
Received on Thursday, 4 August 2011 15:36:27 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:29:46 UTC