Search code examples
iosswiftxcodesketchapp

Difference in colors between Sketch and iPhone simulator


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?

enter image description here


Solution

  • 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:

    enter image description here

    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:

    1. here the color selection:

    enter image description here

    1. then you should see this cake:

    enter image description here

    1. touch on the second button on the top bar

    enter image description here

    1. then you'll have the possibility to change the color space:

    enter image description here

    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.