0

I have a composite svg object with shading and highlights. Is there a way to change the objects color without having to specify changes to the shading & highlighting as well?

I have tried using a greyscale underlying svg and an svg on top where I can change the fill and opacity, but the resulting colors look flat.

Is there a library that does this?

Matt Stevens
  • 1,104
  • 1
  • 12
  • 24

1 Answers1

0

I created an algorithm to loop through the paths of a grey-scale svg where the paths are ordered by shade (ta, Inkscape) and changed the shade to create my colored image.

See tinting a shade and rgbToHex here for useful info.

That worked well. But now I find that to get a "nice" image I have svg files of 150kb (60 paths for shading, roughly 10kb per path with 2 paths costing 36kb). Not so good, especially as the original png was only 21kb. But after googling, it seems mobile app sizes of up to 2gb are ok. Which means mine, probably tipping the scales at around 10mb even with big png files, should be fine.

Community
  • 1
  • 1
Matt Stevens
  • 1,104
  • 1
  • 12
  • 24