KennisbankExamencentrum
NL · NLNederlands (Nederland)
Taal kiezen13

CKTIS / CSS

CSS-eigenschap `lighting-color`

`lighting-color` bepaalt de kleur waarmee de SVG-primitieven `feDiffuseLighting` en `feSpecularLighting` verlichte pixels berekenen.

Versie: CSS modules; captured CSSWG editor index includes draft and obsolete features requiring review

Syntax

<color>

lighting-color bepaalt de kleur waarmee de SVG-primitieven feDiffuseLighting en feSpecularLighting verlichte pixels berekenen.

Het voorbeeld leest het aanvankelijke wit, kent een RGB-kleur toe aan feDiffuseLighting en bevestigt dat een rechthoek dat filter werkelijk gebruikt.

Grammatica: <color>.

De eigenschap geldt voor SVG-belichtingsprimitieven; op gewone HTML ontstaat er geen belichting. Ze erft niet over en color-interpolation-filters beïnvloedt ook de kleurruimte van de berekening.

Voorbeelden

<!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>

Resultaat

primitive=feDiffuseLighting; color=rgb(255, 255, 255)->rgb(10, 20, 30); target-filter=true

Het voorbeeld is lokaal uitgevoerd in een geïsoleerde Chrome-sessie zonder netwerk; het resultaat komt uit de CSS-API van de browser.

Bronnen