Применение теневого цвета с помощью тега feColorMatrix выглядит скучно во всех браузерах. Почему? - PullRequest
0 голосов
/ 16 января 2019

Я создал тень в SVG, используя feColorMatrix для тени, поэтому она синего цвета (rgba (62, 77, 184, 0)).

    <feColorMatrix result="output_0" type="matrix" values="0 0 0 0 0.2 0 0 0 0 0.3 0 0 0 0 0.7 0 0 0 1 0"></feColorMatrix>

Результат должен быть того же синего цвета rgba (62, 77, 184, 1).

Фильтр SVG кажется слишком светлым. Есть ли способ это исправить?

Ответы [ 2 ]

0 голосов
/ 17 января 2019

Ваша математика немного не подходит, и вам нужно указать sRGB. Цветовая матрица должна быть:

<feColorMatrix result="output_0" color-interpolation-filters="sRGB" type="matrix"values="0 0 0 0 0.243 0 0 0 0 0.302 0 0 0 0 0.7215 0 0 0 1 0"/>
0 голосов
/ 16 января 2019

Использовать color-interpolation: "sRGB" в качестве свойства или стиля CSS для тега filter / feColorMatrix. Что такое цветовая интерполяция? Как это работает?

I spend more time to find the reason behind this issue because When I googled it, I didn't see any clear explanation and felt nobody faced kind of issue. After the so much of hard work, I figured it out the solution so I came here to raise the question and share the answer here. Hope Someone will get help from this.

...