Back to Content

Index

files/en-us/web/svg/reference/element/feflood/index.md

latest1.9 KB
Original Source

The <feFlood> SVG filter primitive fills the filter subregion with the color and opacity defined by {{SVGAttr("flood-color")}} and {{SVGAttr("flood-opacity")}}.

Usage context

{{svginfo}}

Attributes

  • {{SVGAttr("flood-color")}}
  • {{SVGAttr("flood-opacity")}}
  • Filter primitive attributes: {{SVGAttr("x")}}, {{SVGAttr("y")}}, {{SVGAttr("width")}}, {{SVGAttr("height")}}, {{SVGAttr("result")}}

DOM Interface

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

Example

HTML

html
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200">
  <defs>
    <filter id="floodFilter" filterUnits="userSpaceOnUse">
      <feFlood
        x="50"
        y="50"
        width="100"
        height="100"
        flood-color="green"
        flood-opacity="0.5" />
    </filter>
  </defs>

  <use filter="url(#floodFilter)" />
</svg>

Result

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

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • SVG Filter primitive attributes
  • {{SVGElement("filter")}}
  • {{SVGElement("animate")}}
  • {{SVGElement("set")}}
  • {{SVGElement("feBlend")}}
  • {{SVGElement("feColorMatrix")}}
  • {{SVGElement("feComponentTransfer")}}
  • {{SVGElement("feComposite")}}
  • {{SVGElement("feConvolveMatrix")}}
  • {{SVGElement("feDiffuseLighting")}}
  • {{SVGElement("feDisplacementMap")}}
  • {{SVGElement("feGaussianBlur")}}
  • {{SVGElement("feImage")}}
  • {{SVGElement("feMerge")}}
  • {{SVGElement("feMorphology")}}
  • {{SVGElement("feOffset")}}
  • {{SVGElement("feSpecularLighting")}}
  • {{SVGElement("feTile")}}
  • {{SVGElement("feTurbulence")}}
  • SVG tutorial: Filter effects