SVGFEColorMatrixElement: width 属性

Baseline 已广泛支持

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

SVGFEColorMatrixElement 接口的只读属性 width 使用 SVGAnimatedLength 来描述 SVG 滤镜图元的水平尺寸。

它反映了 <feColorMatrix> 元素的 width 滤镜图元属性。 <feColorMatrix> 滤镜会对 RGB 颜色和 alpha 值应用矩阵变换。该属性是相对于滤镜区域宽度的 lengthpercentage。 默认值为 100%。属性值是以用户坐标系单位表示的长度。

一个 SVGAnimatedLength 对象。

示例

js
const feColorMatrix = document.querySelector("feColorMatrix");
const horizontalSize = feColorMatrix.width;
console.log(horizontalSize.baseVal.value); // the `width` value

规范

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

浏览器兼容性

另见