specularExponent

**specularExponent** 屬性控制光源的焦點。值越大,光線越亮。

您可以將此屬性與以下 SVG 元素一起使用

示例

html
<svg viewBox="0 0 420 200" xmlns="http://www.w3.org/2000/svg">
  <filter id="diffuseLighting1" x="0" y="0" width="100%" height="100%">
    <feSpecularLighting in="SourceGraphic" specularExponent="1">
      <fePointLight x="60" y="60" z="20" />
    </feSpecularLighting>
  </filter>
  <filter id="diffuseLighting2" x="0" y="0" width="100%" height="100%">
    <feSpecularLighting in="SourceGraphic" specularExponent="5">
      <fePointLight x="60" y="60" z="20" />
    </feSpecularLighting>
  </filter>

  <rect
    x="0"
    y="0"
    width="200"
    height="200"
    style="filter: url(#diffuseLighting1);" />
  <rect
    x="0"
    y="0"
    width="200"
    height="200"
    style="filter: url(#diffuseLighting2); transform: translateX(220px);" />
</svg>

feSpecularLighting

對於 <feSpecularLighting>specularExponent 定義鏡面反射項的指數值。

<number>
預設值 1
可動畫

feSpotLight

對於 <feSpotLight>specularExponent 定義控制光源焦點的指數值。

<number>
預設值 1
可動畫

規範

規範
濾鏡效果模組級別 1
# element-attrdef-fespecularlighting-specularexponent
濾鏡效果模組級別 1
# element-attrdef-fespotlight-specularexponent

另請參閱