CKTIS / CSS
flood-color — SVG filter primitive flood color
The flood-color property sets the color used by the SVG filter primitives feFlood and feDropShadow. It is not a replacement for fill.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
flood-color: <color>;flood-color accepts <color>, initially black, and is not inherited. It applies to feFlood and feDropShadow elements and is also available as an SVG presentation attribute.
feFlood fills the rectangular filter primitive subregion, while feDropShadow uses this color for its shadow. The color's alpha channel is multiplied by flood-opacity.
In the example, the feFlood result replaces the red rectangle with green. Setting flood-color on the rectangle itself does not replace fill: set the property on the relevant filter primitive.
Examples
<!doctype html>
<meta charset="utf-8">
<title>flood-color</title>
<style>
#paint { flood-color: #008000; }
</style>
<svg xmlns="http://www.w3.org/2000/svg" width="120" height="80" viewBox="0 0 120 80">
<defs>
<filter id="flood" x="0" y="0" width="1" height="1"
filterUnits="objectBoundingBox">
<feFlood id="paint" flood-opacity="1" />
</filter>
</defs>
<rect width="120" height="80" fill="red" filter="url(#flood)" />
</svg>Result
A solid green (#008000) rectangle, 120 × 80 CSS pixels, instead of the red source rectangle.
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.