W3C home > Mailing lists > Public > www-svg@w3.org > March 2006

Re: SVG12: animation with indirect values

From: Chris Lilley <chris@w3.org>
Date: Wed, 22 Mar 2006 01:42:39 +0100
Message-ID: <1904663425.20060322014239@w3.org>
To: www-svg@w3.org
Cc: Bjoern Hoehrmann <derhoermi@gmx.net>

Hello www-svg,

Bjoern Hoehrmann <derhoermi@gmx.net> wrote:

> This seems wrong ("may be inherited"?)

Yes, should be "may be animated" - fixed.

>  and misses my point.

No, it seems to address it. The computed value of fill="inherit" or
fill="currentColor" is a scalar color value. See below.

> For the example I gave
> 
>   <rect color="green" fill="#000000" height="100" width="100">
>     <animateColor attributeName="fill"
>                   from="#000000" to="currentColor"
>                   begin="0s" dur="3s" fill="freeze" />
>   </rect>
> 
> an implementation would need to determine some numeric value for the
> currentColor keyword

yes

> and the specification does not say which value
> that might be.

 currentColor
    Indicates that painting shall be done using the color specified
    by the current animated value of the 'color' property.
    
> If this is allowed, the specification would need to say
> for which element the computed value of the color property would be
> considered,

in your example, the rect element. The fill attribute on the rect
element is animated from #000000 to currentColor, exactly as the
animation element says. The value of the 'to' attribute is simply a
string. The animation engine then works out that currentColor evaluates
to green which is rgb( 0, 128, 0) and thus, the fill can be smoothly
animated.

To make this more explicit, lets adjust your example:

  <rect color="green" fill="#000000" height="100" width="100">
    <animateColor attributeName="fill"
                  from="#000000" to="currentColor"
                  color="red"
                  begin="0s" dur="3s" fill="freeze" />
  </rect>

This still animates from black to green, not black to red. The end point
of the animation looks the same as if a script were to change the fill
attribute of the rect element to "currentColor". This is unaffected by
the value of the color property on the animateColor element.

> when that would happen, and what happens if the computed value changes
> while the animation is running. So this does not address my concern.

If the computed value of color changes then the computed value of
currentColor also changes, as the new text makes clear.

  <rect color="green" fill="#000000" height="100" width="100">
    <animateColor attributeName="fill"
                  from="#000000" to="currentColor"
                  color="red"
                  begin="0s" dur="3s" fill="freeze" />
    <animateColor attributeName="color"
                  from="red" to="yellow"
                  begin="1s" dur="2s" fill="freeze" />
  </rect>

From 0 to 1s the rect will change from black towards green, then at 1s
it will be between black and red, and at 3s it will have finished
animating to yellow.

Please let us know shortly if this revised text and the explanations
given do not resolve your concerns.

-- 
 Chris Lilley                    mailto:chris@w3.org
 Chair, W3C SVG Working Group
 W3C Graphics Activity Lead
 Co-Chair, W3C Hypertext CG
Received on Wednesday, 22 March 2006 00:42:43 GMT

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