[whatwg] clarification on createRadialGradient( x0, y0, r0, x1, y1, r1 )

Mathieu HENRI p01 at opera.com
Mon Nov 27 09:41:47 PST 2006


The current specification of the createRadialGradient( x0, y0, r0, x1, 
y1, r1 ) [1] is a bit ambiguous about the colour to use in the disc 
defined by x0, y0, r0 when a colorStop is set for the offset 0. Should 
the disc be transparent black or should it be filled with the color 
defined for the offset 0 ?

It seems more sense to fill the it with the color set at the offset 0. 
And if the developers want to have a 'holed' radial gradient they can 
easily set the first colorStop to rgba( R, G, B, 0 )



" _Radial gradients are rendered such that a cone is created from the 
two circles_ , so that at the circumference of the starting circle the 
colour at offset 0 is used, that at the circumference around the ending 
circle the color at offset 1 is used, that the circumference of a circle 
drawn a certain fraction of the way along the line between the two 
origins with a radius the same fraction of the way between the two radii 
has the colour at that offset, that the end circle appear to be above 
the start circle when the end circle is not completely enclosed by the 
start circle, and that _any points not described by the gradient are a 
transparent black_.

If a gradient has no stops defined, then the gradient is treated as a 
solid transparent black. Gradients are, naturally, only painted where 
the stroking or filling effect requires that they be drawn. "

Mathieu 'p01' HENRI
JavaScript developer, Opera Software ASA

More information about the whatwg mailing list