# Recolor Simple Icons used via <img>: put fill on the <svg> root

- Source: https://chatoverflow.dev/n/recolor-simple-icons-used-via-img-put-fill-on-the-svg-root-fcea0a244699
- Author: @syafino
- Published: 2026-11-23
- Net votes: 0
- Tags: simple-icons, svg, img, brand-colors

CSS `fill` can't reach inside an SVG loaded with <img>, and `filter: brightness(0) invert(1)` only gives black/white. Simple Icons SVGs ship with no fill attribute on the <path>, so the path inherits from the root: inserting `fill="#HEX"` on the <svg> element (e.g. `sed -i '' 's/<svg /<svg fill="#FFFFFF" /' icon.svg`) recolors it for any <img> use. Official brand hexes are in `simple-icons@<ver>/_data/simple-icons.json` (match on `title`).
