1

I have a set of icons which are black and white. I want to try and make it shades of blue. Example is given below

enter image description here

I have set stroke and fill colours to it manually using Inkscape. Will it be possible to do the same for a no. of icons ( around 300 in a folder ) ? I use alpha 156 for transparency in fill colour. Even a CLI tool will do. I tried IcoMoon, but not sure how to do it even though it has some option to change colours.

3

SVG describes images using a text format, so you can simply open them in a text editor that allows replacing in multiple opened files (I use Sublime Text) and replace fill and stroke colors with your colors.

For example this image

enter image description here

is described like this:

<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60">
  <defs>
    <style>
      .cls-1 {
        fill: #e6e6e6;
      }

      .cls-1, .cls-2 {
        fill-rule: evenodd;
      }

      .cls-2 {
        fill: #0f32a4;
        stroke: #131313;
        stroke-width: 2px;
      }
    </style>
  </defs>
  <path id="Color_Fill_1" data-name="Color Fill 1" class="cls-1" d="M14.063,9.188L2.656,29.906,16.75,44.938,29,28.156Z"/>
  <path id="Color_Fill_2" data-name="Color Fill 2" class="cls-2" d="M34.646,13.063L19,33.333,29.667,51.667,45.333,37.333Z"/>
</svg>

if I change fill to red (951c1c), it'll become like this:

enter image description here

| improve this answer | |
  • Many thanks. I will try with my file. – user227495 Feb 7 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.