This is a recreation (for the purpose of tinkering with an implementation in d3.js) of the example from the book SVG Essentials by J. David Eisenberg.
The <feColorMatrix>
element allows to change color values in a following way.
<filter id="glow">
<feColorMatrix type="matrix" values=
"0 0 0 red 0
0 0 0 green 0
0 0 0 blue 0
0 0 0 1 0"/>
<feGaussianBlur stdDeviation="number" result="coloredBlur"/>
<feMerge>
<feMergeNode in="coloredBlur"/>
<feMergeNode in="SourceGraphic"/>
</feMerge>
</filter>
Works like a charm, but there's a bug that has a very simple fix. The matrix requires values between 0-1, but d3 returns values between 0-256 so you need to divide the colours by 256 (lines 45-47). Thanks for sharing!