Xcode生成具有不同颜色的png格式的pdf [英] Xcode generates png form pdf with different colors

查看:84
本文介绍了Xcode生成具有不同颜色的png格式的pdf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在关注在iOS项目中使用pdf矢量资源的文章: http: //martiancraft.com/blog/2014/09/vector-images-xcode6/

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

但是我们遇到了问题.如果我们在Photoshop/Illustrator中将颜色设置为#039AF0,则导出的pdf将生成具有#1185ec颜色的png.

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

如果我们使用旧的png方式,那么颜色就可以了(请忽略像素化图像,最重要的是颜色):

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

可能是什么原因?

推荐答案

在Illustrator中创建新的画板时,默认情况下将Adobe RGB用于色彩空间,这不适用于iOS.为了确保颜色尽可能接近原始颜色,请在高级"下,通过为配置文件"选择"Web",为颜色模式"选择RGB,将颜色空间设置为sRGB.

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文件作为在Adobe RGB中创建的可交付成果.在这种情况下,我会先将粘贴的矢量路径复制到设置为sRGB的新画板上,然后再另存为PDF以在Xcode 6中使用.

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.

这篇关于Xcode生成具有不同颜色的png格式的pdf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆