flood-color

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

Thuộc tính flood-color chỉ ra màu nào sẽ được dùng để lấp đầy subregion của primitive bộ lọc hiện tại.

Note: Là một thuộc tính trình bày, flood-color cũng có một thuộc tính CSS tương ứng: flood-color. Khi cả hai được chỉ định, thuộc tính CSS sẽ được ưu tiên.

Bạn có thể dùng thuộc tính này với các phần tử SVG sau:

Ví dụ

html
<svg viewBox="0 0 420 200" xmlns="http://www.w3.org/2000/svg">
  <filter id="flood1">
    <feFlood flood-color="skyblue" x="0" y="0" width="200" height="200" />
  </filter>
  <filter id="flood2">
    <feFlood flood-color="seagreen" x="0" y="0" width="200" height="200" />
  </filter>

  <rect x="0" y="0" width="200" height="200" filter="url(#flood1)" />
  <rect x="220" y="0" width="200" height="200" filter="url(#flood2)" />
</svg>

Ghi chú sử dụng

Giá trị color
Giá trị khởi tạo black
Có thể animate

Đặc tả

Specification
Filter Effects Module Level 1
# FloodColorProperty

Tương thích trình duyệt

Xem thêm