Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode generates png form pdf with different colors

We are following article to use pdf vector resources in iOS project: http://martiancraft.com/blog/2014/09/vector-images-xcode6/

However we faced problems. If we set color in Photoshop/Illustrator to #039AF0 then exported pdf will generate png with #1185ec color.

enter image description here

If we use old png way then colors are fine (please ignore pixelized image, the most important is color):

enter image description here

What can be the cause?

like image 302
Eugen Martynov Avatar asked Oct 13 '14 08:10

Eugen Martynov


2 Answers

When a new artboard is created in Illustrator it defaults to using Adobe RGB for the color space which doesn't work well with iOS. To make sure the colors remain as close to the original as possible, set the color space to sRGB by selecting "Web" for Profile and RGB for Color Mode under Advanced.

illustrator settings

This works well for new artboards. I have an Illustrator file as a deliverable that was created in Adobe RGB. For such cases, I've resorted to copy pasting vector paths on a new artboard that's set to sRGB before saving as PDF for use in Xcode 6.

like image 169
Pasan Premaratne Avatar answered Sep 20 '22 19:09

Pasan Premaratne


I got the same problem, and finally I found that set the deployment Target to 7.0 or above solves the problem.

like image 28
day Avatar answered Sep 22 '22 19:09

day