Re: stroke=gradient for lines or horizontal paths

(Apologies for not chiming in earlier here - for some reason I never
got subscribed to www-svg when I joined the WG.  This has been
remedied.)

I strongly agree that gradients should paint in 0width or 0height
bounding boxes.  The gradient is still conceptually well-defined in
these cases.

For linear gradients with spreadmethod=pad, if the gradient is aligned
exactly opposite the bbox, it's just 0-length, and thus defines a
two-color image (the color of the first <stop> and the color of the
last <stop>).  Otherwise, it's identical to if the gradient was
aligned with the bbox and was the length of the bbox.

For radial gradients with spreadmethod=pad, it always defines a
solid-color image with the color of the last <stop>.

spreadmethod=reflect or repeat are more difficult, though, because
there is no first or last <stop>, conceptually.  Right now, CSS Images
punts on the issue and requires repeating gradients to clamp their
width to a minimum of 1px.  I'm open to better solutions, though
(weighted average?), and would like to ensure that CSS gradients align
with SVG gradients here.

~TJ

Received on Saturday, 23 July 2011 01:00:50 UTC