B
B
BanterFace2016-12-23 18:24:35
SVG
BanterFace, 2016-12-23 18:24:35

How to set inner shadow for svg?

Hello. You need to set an inner shadow for path. I found a filter on Habré, here:

<filter id="inset-shadow">

<!-- Сдвиг тени -->
<feOffset dx="0" dy="0"></feOffset>

<!-- Размытие тени -->
<feGaussianBlur stdDeviation="20" result="offset-blur"></feGaussianBlur>

<!-- Инвертируем drop shadow
чтобы создать внутреннюю тень -->
<feComposite operator="out" in="SourceGraphic" in2="offset-blur" result="inverse"></feComposite>

<!-- Цвет и Прозрачность -->
<feFlood flood-color="black" flood-opacity="0.65" result="color"></feFlood>

<!-- Обрезаем цвет внутрь тени -->
<feComposite operator="in" in="color" in2="inverse" result="shadow"></feComposite>

<!-- Раcполагаем тень поверх элемента -->
<feComposite operator="over" in="shadow" in2="SourceGraphic"></feComposite>
</filter>

But: it also darkens the storke, which I do not need. Is there a filter that doesn't touch storke, or is there some other way to set the border besides storke="" that will allow this filter to be applied normally?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question