W3C home > Mailing lists > Public > www-svg@w3.org > July 2011

Re: stroke=gradient for lines or horizontal paths

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 22 Jul 2011 18:00:04 -0700
Message-ID: <CAAWBYDBkgJ-iSfYdToC-5Vt1rK4hVsyZQm-6cDMG8rg+LANWxA@mail.gmail.com>
To: www-svg <www-svg@w3.org>
(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 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:48 GMT