tableValues

Thuộc tính tableValues định nghĩa một danh sách các số tạo thành bảng tra cứu giá trị cho một hàm chuyển đổi thành phần màu.

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">
  <defs>
    <linearGradient
      id="gradient"
      gradientUnits="userSpaceOnUse"
      x1="0"
      y1="0"
      x2="200"
      y2="0">
      <stop offset="0" stop-color="red" />
      <stop offset="0.5" stop-color="lime" />
      <stop offset="1" stop-color="blue" />
    </linearGradient>
  </defs>

  <filter id="componentTransfer1" x="0" y="0" width="100%" height="100%">
    <feComponentTransfer>
      <feFuncR type="table" tableValues="0 1" />
      <feFuncG type="table" tableValues="0 1" />
      <feFuncB type="table" tableValues="0 1" />
    </feComponentTransfer>
  </filter>
  <filter id="componentTransfer2" x="0" y="0" width="100%" height="100%">
    <feComponentTransfer>
      <feFuncR type="table" tableValues="1 0" />
      <feFuncG type="table" tableValues="1 0" />
      <feFuncB type="table" tableValues="1 0" />
    </feComponentTransfer>
  </filter>

  <rect
    x="0"
    y="0"
    width="200"
    height="200"
    fill="url(#gradient)"
    filter="url(#componentTransfer1)" />
  <rect
    x="220"
    y="0"
    width="200"
    height="200"
    fill="url(#gradient)"
    filter="url(#componentTransfer2)" />
</svg>

Ghi chú sử dụng

Giá trị <list-of-numbers>
Giá trị mặc định Danh sách rỗng dẫn đến phép chuyển đổi đồng nhất
Có thể hoạt ảnh Yes
<list-of-numbers>

Giá trị này chứa một danh sách các số <number> được phân tách bằng dấu phẩy và/hoặc khoảng trắng, xác định một bảng tra cứu cho hàm chuyển đổi thành phần màu. Mỗi số có thể nằm trong khoảng từ 0 đến 1.

Một danh sách rỗng dẫn đến một hàm chuyển đổi đồng nhất.

Đặc tả

Specification
Filter Effects Module Level 1
# element-attrdef-fecomponenttransfer-tablevalues