W3C home > Mailing lists > Public > www-style@w3.org > May 2012

Re: [css3-images] interpolation of color stop positions (was Re: Change to currentColor means it's no longer animatable?)

From: Chris Lilley <chris@w3.org>
Date: Wed, 2 May 2012 05:32:29 +0200
Message-ID: <1878080174.20120502053229@w3.org>
To: Brian Manthos <brianman@microsoft.com>
CC: Tab Atkins Jr. <jackalmage@gmail.com>, Shane Stephens <shans@google.com>, "L. David Baron" <dbaron@dbaron.org>, www-style list <www-style@w3.org>
On Tuesday, May 1, 2012, 10:58:48 PM, Brian wrote:

BM> In animation cases, it effectively removes a feature (and adds a new one).

BM> As such "in the wild" we don't really have data yet because
BM> animations + gradients is new territory.

CSS animations plus CSS gradients is new territory. Gradients, animations, and animating gradients have been in SVG since 1998, and commonly used in SVG content.

Which I assume everyone knows, although statements like the above make me wonder.

Gradient stop positions and gradient stop colors and opacities are all animatable. However, the rules for stop ordering are different:

"Each gradient offset value is required to be equal to or greater than the previous gradient stop's offset value. If a given gradient stop's offset value is not equal to or greater than all previous offset values, then the offset value is adjusted to be equal to the largest of all previous offset values."
"If two gradient stops have the same offset value, then the latter gradient stop controls the color value at the overlap point."
http://www.w3.org/TR/SVG/pservers.html#GradientStops

BM> We should probably at least have a note in CSS3 that it is likely
BM> the rule ordering will change in CSS4 so that authors have a
BM> warning now rather than having content break later.
 

Yes. Although I don't see stop-position resolution as "layout", it does depend on layout once units, calc and such are mixed in.

I'd like to see a worked example where a CSS gradient with out of order stops is specified, gets interpolated, layout reorders the stops, and some rendering happens that does not require re-interpolation and does not risk banding.


-- 
 Chris Lilley   Technical Director, Interaction Domain                 
 W3C Graphics Activity Lead, Fonts Activity Lead
 Co-Chair, W3C Hypertext CG
 Member, CSS, WebFonts, SVG Working Groups
Received on Wednesday, 2 May 2012 03:32:54 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:53 GMT