HTML Editor
<!DOCTYPE html> <html lang="en-US"> <body> <svg width="450" height="150" xmlns="http://www.w3.org/2000/svg"> <!-- No light is applied --> <text text-anchor="middle" x="60" y="22">No Light</text> <circle cx="60" cy="80" r="50" fill="#339933" /> <!-- the light source is a fePointLight element --> <text text-anchor="middle" x="170" y="22">fePointLight</text> <filter id="point"> <feDiffuseLighting in="SourceGraphic" result="light" lighting-color="white"> <fePointLight x="150" y="60" z="30" /> </feDiffuseLighting> <feComposite in="SourceGraphic" in2="light" operator="arithmetic" k1="1" k2="0" k3="0" k4="0"/> </filter> <circle cx="170" cy="80" r="50" fill="#339933" filter="url(#point)" /> <!-- the light source is a feDistantLight element --> <text text-anchor="middle" x="280" y="22">feDistantLight</text> <filter id="point1"> <feDiffuseLighting in="SourceGraphic" result="light" lighting-color="white"> <feDistantLight azimuth="240" elevation="20"/> </feDiffuseLighting> <feComposite in="SourceGraphic" in2="light" operator="arithmetic" k1="1" k2="0" k3="0" k4="0"/> </filter> <circle cx="280" cy="80" r="50" fill="#339933" filter="url(#point1)" /> <!-- the light source is a feSpotLight source --> <text text-anchor="middle" x="390" y="22">feSpotLight</text> <filter id="point2"> <feDiffuseLighting in="SourceGraphic" result="light" lighting-color="white"> <feSpotLight x="360" y="5" z="30" limitingConeAngle="20" pointsAtX="390" pointsAtY="80" pointsAtZ="0"/> </feDiffuseLighting> <feComposite in="SourceGraphic" in2="light" operator="arithmetic" k1="1" k2="0" k3="0" k4="0"/> </filter> <circle cx="390" cy="80" r="50" fill="#339933" filter="url(#point2)" /> </svg> </body> </html>
OUTPUT
×

Save as Private