MDN self-hosted library · e01.org

SVGFEDiffuseLightingElement: surfaceScale property

SVG

Open notebook · 2 cells web-api-instance-property upstream source

SVG

The surfaceScale read-only property of the SVGFEDiffuseLightingElement interface reflects the surfaceScale attribute of the given feDiffuseLighting element.

Value

An SVGAnimatedNumber object.

Examples

Access the surfaceScale property

<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
  <defs>
    <filter id="diffuseLightingFilter">
      <feDiffuseLighting
        in="SourceGraphic"
        surfaceScale="2"
        lighting-color="white">
        <feDistantLight azimuth="45" elevation="55" />
      </feDiffuseLighting>
    </filter>
  </defs>
  <rect
    x="20"
    y="20"
    width="100"
    height="100"
    fill="lightblue"
    filter="url(#diffuseLightingFilter)" />
</svg>
const diffuseLighting = document.querySelector("feDiffuseLighting");

console.log(diffuseLighting.surfaceScale.baseVal); // Output: 2

Specifications

Browser compatibility

See also

  • SVGAnimatedNumber