2018: If you want a dynamic color, do not want to use javascript and do not want an inline SVG, use a CSS variable. Works in Chrome, Firefox and Safari. edit: and Edge
In your SVG, replace any instances of style="fill: #000" with style="fill: var(--color_fill)".