Thread: [SailfishOS] Pure Maps
View Single Post
Posts: 1,414 | Thanked: 7,547 times | Joined on Aug 2016 @ Estonia
#133
Originally Posted by MartinK View Post
It's something like palette swapping doable for SVG ? I works fine for games to differentiate players with the same model so I guess the same mechanism could be used to palette swap icons/indicators to better work with the given map style while keeping the icons otherwise the same geometry wise (of course one needs to make sure the palette swapped colors don't blend together).

I don't have a very deep insight into SVG & SVG rendering, but every SVG is basically a XML file, so in the simplest case it should be possible to quite easily palette swap a set of master icons by sedding the color strings to different ones for each variant, during development or at build time.

In more advanced cases the SVG code could be processed at runtime & fed to either PyOtherSide image provider (it takes byte arrays & supports proper SVG rendering) or to temporary files.

So, just an idea.
As you suggested, sed is a friend. In WhoGo/Pure Maps, the icons are generated before making RPM packages at different sizes. So, I can just run sed and replace the colors accordingly. In this aspect, the palettes are available

I'll try to remember your more advanced option, just as a part of education.
 

The Following 7 Users Say Thank You to rinigus For This Useful Post: