CKTIS / CSS
Vlastnosť CSS `lighting-color`
`lighting-color` určuje farbu, z ktorej primitíva SVG `feDiffuseLighting` a `feSpecularLighting` počítajú osvetlené pixely.
Verzia: CSS modules; captured CSSWG editor index includes draft and obsolete features requiring review
Syntax
<color>lighting-color určuje farbu, z ktorej primitíva SVG feDiffuseLighting a feSpecularLighting počítajú osvetlené pixely.
Príklad prečíta počiatočnú bielu, nastaví prvku feDiffuseLighting farbu RGB a overí, že obdĺžnik tento filter skutočne používa.
Gramatika: <color>.
Vlastnosť platí pre osvetľovacie primitíva SVG; na bežnom HTML osvetlenie nevytvorí. Nededí sa a farebný priestor výpočtu ovplyvňuje aj color-interpolation-filters.
Príklady
<!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>Výsledok
primitive=feDiffuseLighting; color=rgb(255, 255, 255)->rgb(10, 20, 30); target-filter=true
Príklad bol spustený lokálne v izolovanej relácii Chrome bez siete; výsledok pochádza z CSS API prehliadača.