<fePointLight>

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.

La primitive de filtre <fePointLight> définit une source de lumière qui permet de créer un point lumineux. On la place dans une primitive de filtre d'éclairage: <feDiffuseLighting> or <feSpecularLighting>.

Contexte d'utilisation

CatégoriesÉlément de source de lumière
Contenu autoriséTout élément de cette liste, quel qu'en soit l'ordre :
<animate>, <set>

Attributs

Attributs globaux

Attributs spécifiques

Interface DOM

Cet élément implémente l'interface SVGFEPointLightElement.

Exemple

SVG

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="80"
        lighting-color="#FFF">
        <fePointLight x="50" y="50" z="220" />
      </feSpecularLighting>
      <feComposite
        in="SourceGraphic"
        in2="spotlight"
        operator="arithmetic"
        k1="0"
        k2="1"
        k3="1"
        k4="0" />
    </filter>
  </defs>

  <image
    xlink:href="/files/6457/mdn_logo_only_color.png"
    x="10%"
    y="10%"
    width="80%"
    height="80%"
    style="filter:url(#spotlight);" />
</svg>

Résultat

Spécifications

Specification
Filter Effects Module Level 1
# fePointLightElement

Compatibilité des navigateurs

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
fePointLight
x
y
z

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

Voir aussi