--- title: animateColor slug: Web/SVG/Element/animateColor tags: - SVG - SVG动画 - 元素 - 需要兼容性表 translation_of: Web/SVG/Element/animateColor ---
{{SVGRef}}{{deprecated_header}}

该元素在SVG1.1 第二版中不建议使用,在将来的SVG版本中可能被移除。它提供的功能,在{{ SVGElement("animate") }}元素中都可用,而且不能在火狐或Internet Explorer中实现。作者必须使用{{ SVGElement("animate") }}元素代替它。

<animateColor> SVG元素指定了一个颜色随着时间的变换。

用法

{{svginfo}}

属性

全局属性

特定属性

DOM Interface

This element implements the {{domxref("SVGAnimateColorElement")}} interface.

Example

SVG

<svg width="120" height="120" xmlns="http://www.w3.org/2000/svg">
  <circle cx="60" cy="60" r="50">
    <animateColor attributeName="fill" attributeType="XML"
        from="black" to="red" dur="6s" repeatCount="indefinite"/>
  </circle>
</svg>

Result

{{EmbedLiveSample("Example", 120, 120)}}

Specifications

Specification Status Comment
{{SpecName("SVG1.1", "animate.html#AnimateColorElement", "<animateColor>")}} {{Spec2("SVG1.1")}} Initial definition

Browser compatibility

{{Compat("svg.elements.animateColor")}}

See also