Is there a correct way to tint PDF icons for iOS?

96 Views Asked by At

I'm a UX designer - so bear with me. We have an issue where we want to use PDF files as icons for our iOS app. This works fine if we were to only use them in one color. However we have situations where we need to change the color based on the BG they are used on.

The issue is that we are not able to tint the PDFs - they remain white.

The icons are all made in Figma and are used for web / android and iOS. They work perfectly as SVGs and are flattened - so that should not be the issue. Might it have something to do with the way PDF exports work from Figma perhaps?

To tint the PDFs we use renderingMode(_:) which does not seem to actually tint our PDF icons. It works for PNGs, which of course is not optimal as the icons turn out very grainy.

Here is an example of the code used:

SwiftUI.Image.init(uiImage: uiImage)
.renderingMode(.template)
.foregroundColor(label.tintColor)

Here is an example SVG & PDF from the icons that do not work: Icons from Wetransfer

0

There are 0 best solutions below