Please, can you explain me why I do have so big difference in the colors between my sketch design and what I see on my iphone simulator? In this case, I was using background picture from sketch and it was not changed at all but the difference is huge. How can I make it look the same?
Asked
Active
Viewed 1,714 times
2
-
how do you use this color inside the app? – Vyacheslav Jan 25 '18 at 21:43
-
It is just a picture of the background. let imageViewBg = UIImageView(image: UIImage(named: "MenuBg")) tableView.backgroundView = imageViewBg – Juri Jan 25 '18 at 21:44
-
Have you tried to reopen saved image in macos preview? It might be that you saved this file in web-safe colors. – Vyacheslav Jan 25 '18 at 21:48
-
Vyacheslav do you speak Russian? ;) – Juri Jan 25 '18 at 21:53
-
Yes, I can. But this forum is in English. Use https://ru.stackoverflow.com/ to ask in Russian. – Vyacheslav Jan 25 '18 at 21:55
-
No English is fine. Yes I did open image on my mac and it looks like on my iPhone simulator not like on the sketch. The funny thing I used colour picker to get background colour from sketch image and placed it into the code and it is still a huge difference. Is it possible that sketch does not show correct colours? – Juri Jan 25 '18 at 22:01
-
Try to change a color scheme – Vyacheslav Jan 25 '18 at 22:10
1 Answers
8
I guess may be a problem related to the color space, Sketch documentation and here. So basically Sketch uses by default the Unmanaged color profile
, which means your system’s default color profile — ‘Color LCD’ on a MacBook Pro for example:
Instead on Xcode you should have sRGB IEC61966-2.1
, to be able to change the color you should touch the color selection of the UIView
that you have to modify, eg:
- here the color selection:
- then you should see this cake:
- touch on the second button on the top bar
- then you'll have the possibility to change the color space:
Of course it's possible to do the same thing by code, since you have to mess with CGColorSpaceModel
and color transformations, it's just a bit more verbose.
So, before to export (Sketch) and run on simulator (Xcode), a solution might be check to have selected on both applications the same color space: sRGB IEC61966-2.1
.
-
Thanks for the explanation. I did set up it in Sketch. How can I do it in my Xcode? – Juri Jan 25 '18 at 22:13