Search code examples
iosuicolor

why I get slightly different colour even though I put the same RGB number?


enter image description here

In launchScreen.StoryBoard I set the colour manually using color picker like the picture above. as you can see red = 255, green=171, blue=0

from the launch screen, it will contiune to MainVC, in MainVC, I set the splash screen when fetching data from the internet

and because I use the library, I should put the colour programatically. I use the code below to generate the colour

backgroundColor: UIColor(red:255/255, green:171/255, blue:0/255, alpha:1.0)

I think I have put exactly the same RGB number , but the result is slightly different.

you can see from the gif file in here: http://g.recordit.co/tANf6VH4iC.gif the colour near the logo will be different after around 2 seconds


Solution

  • Open the color scheme settings by clicking enter image description here button and then select sRGB XXXXX scheme as shown below. Now correct the RGB values and see the results.

    enter image description here