<feSpotLight>
<feSpotLight> SVG 濾鏡基元定義了一個可用於建立聚光燈效果的光源。它用在濾光器基元中:<feDiffuseLighting> 或 <feSpecularLighting>。
與其它濾鏡圖元一樣,它預設在 linearRGB 顏色空間中處理顏色分量。您可以使用 color-interpolation-filters 屬性改為使用 sRGB。
使用語境
屬性
DOM 介面
此元素實現了 SVGFESpotLightElement 介面。
示例
HTML
html
<svg
width="200"
height="200"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<filter id="spotlight">
<feSpecularLighting
result="spotlight"
specularConstant="1.5"
specularExponent="4"
lighting-color="white">
<feSpotLight x="600" y="600" z="400" limitingConeAngle="5.5" />
</feSpecularLighting>
<feComposite
in="SourceGraphic"
in2="spotlight"
operator="out"
k1="0"
k2="1"
k3="1"
k4="0" />
</filter>
</defs>
<image
href="mdn_logo_only_color.png"
x="10%"
y="10%"
width="80%"
height="80%"
filter="url(#spotlight)" />
</svg>
結果
規範
| 規範 |
|---|
| 濾鏡效果模組第 1 級 # feSpotLightElement |
瀏覽器相容性
載入中…