SVGFEColorMatrixElement: result 属性

Baseline 已广泛支持

此特性已相当成熟,可在许多设备和浏览器版本上使用。自 ⁨2015 年 7 月⁩以来,各浏览器均已提供此特性。

SVGFEColorMatrixElement 接口的只读属性 result,描述了 SVG 滤镜图元被指定为一个 SVGAnimatedString 的名称。

它反映了 <feColorMatrix> 元素的 result 属性。<feColorMatrix> 滤镜对 RGB 颜色和 Alpha 值应用矩阵变换。该属性的值是一个 <custom-ident>。如果提供了该属性,则处理此滤镜图元产生的图形可以通过同一 <filter> 元素内后续滤镜图元的 in 属性进行引用。

如果未定义 result 属性,则滤镜的 result.baseValresult.animVal 将为空字符串,并且 <feColorMatrix> 滤镜的输出将仅作为隐式输入供下一个滤镜图元重用,前提是该滤镜图元未为其 in 属性提供值。

一个 SVGAnimatedString

示例

js
const feColorMatrixElement = document.querySelector("feColorMatrix");
const filterName = feColorMatrixElement.result;
console.log(filterName.baseVal); // the filter's assigned name

规范

规范
滤镜效果模块第 1 级
# dom-svgfilterprimitivestandardattributes-result

浏览器兼容性

另见