CKTIS / CSS
CSS-Eigenschaft `lighting-color`
`lighting-color` legt die Farbe fest, aus der die SVG-Primitive `feDiffuseLighting` und `feSpecularLighting` beleuchtete Pixel berechnen.
Version: CSS modules; captured CSSWG editor index includes draft and obsolete features requiring review
Syntax
<color>lighting-color legt die Farbe fest, aus der die SVG-Primitive feDiffuseLighting und feSpecularLighting beleuchtete Pixel berechnen.
Das Beispiel liest das anfängliche Weiß, weist feDiffuseLighting eine RGB-Farbe zu und bestätigt, dass ein Rechteck diesen Filter tatsächlich verwendet.
Grammatik: <color>.
Die Eigenschaft gilt für SVG-Beleuchtungsprimitive; auf gewöhnlichem HTML erzeugt sie keine Beleuchtung. Sie wird nicht vererbt, und color-interpolation-filters beeinflusst ebenfalls den Farbraum der Berechnung.
Beispiele
<!doctype html>
<html lang="en"><meta charset="utf-8"><title>lighting-color behavior</title>
<body><svg width="40" height="40"><filter id="f"><feDiffuseLighting id="light" surfaceScale="1"><feDistantLight azimuth="45" elevation="60"/></feDiffuseLighting></filter><rect id="sample" width="40" height="40" filter="url(#f)"/></svg><pre id="result"></pre><script>
const light=document.querySelector('#light');const sample=document.querySelector('#sample');
const before=getComputedStyle(light).lightingColor;light.style.lightingColor='rgb(10 20 30)';const after=getComputedStyle(light).lightingColor;
document.querySelector('#result').textContent='primitive='+light.localName+'; color='+before+'->'+after+'; target-filter='+(getComputedStyle(sample).filter!=='none');
</script></body></html>Ergebnis
primitive=feDiffuseLighting; color=rgb(255, 255, 255)->rgb(10, 20, 30); target-filter=true
Das Beispiel lief lokal in einer isolierten Chrome-Sitzung ohne Netzwerk; das Ergebnis stammt aus der CSS-API des Browsers.