Transform black to any color with CSS filters

Once in a while I come across an SVG file that isn’t the color I want and it doesn’t follow the CSS color: directive. You can always open the SVG file in a text editor and change the colors that way, but if that’s a little much you can always just leave the SVG file alone and transform its color with a CSS filter. Here are some links that go into more detail:

https://stackoverflow.com/questions/42966641/how-to-transform-black-into-any-given-color-using-only-css-filters

https://stackoverflow.com/questions/24933430/img-src-svg-changing-the-styles-with-css

CSS filter generator: https://codepen.io/sosuke/pen/Pjoqqp

Leave a Comment