iOS LaunchScreen background color incorrect

JamesFormicaJamesFormica AUMember

Hi all,

My team is creating a Xamarin Forms app and have a very simple LaunchScreen.storyboard for my iOS project. It has a logo in the middle and I've set the UIView's background color to rgba(17, 104, 179, 255) it is a darkish blue. In the preview window in visual studio the color shown is correct, however when i deploy the app to either an iOS device or the simulator the background color is incorrect. I took a screen shot of the launchscreen and the color rendered is rgba(11, 126, 193, 255) a slightly different blue.

I have no idea why it would be doing this or if I have done something wrong. Any help is greatly appreciated :smile:

Thanks,
James

Posts

  • JGoldbergerJGoldberger Xamurai USMember, Forum Administrator, Xamarin Team, University Xamurai

    Different displays will present colors differently. How did you measure the color values after you took the screenshot? Not sure how accurate measuring the color will be after taking a screen shot from a device and and displaying that screen shot on your PC.

    Also you say "In the preview window in visual studio the color shown is correct" but how do you know? I assume you set the color you want by looking at it in the preview in VS, so it should be "correct" there. How it looks on your PC monitor is not a 100% accurate idea of how it will look on any other display.

  • PatrickLongPatrickLong ✭✭ USMember ✭✭

    I have a similar issue without launch screen storyboard. I am setting the BackgroundColor of the SB in VS editor o RGB of 30, 129, 231.

    For other screens in the app we do this in code. That color is correct elsewhere in app but in LaunchScreen it is displayed as 33, 150, 236!

    I am measuring the displayed colour by screen-shotting the launch screen, as the app loads, then sharing that screenshot and the screenshot of one of the other main screens in the app. When I load the shared screenshots into an image editor i can see the colours are not the same. What is going on?

  • JimKoehlerJimKoehler ✭✭ USMember ✭✭

    I'm also having the same problem as @JamesFormica and @PatrickLong. And I don't think it's how different displays show colors different as @JGoldberger suggested since I'm relying on tools and not my eyes to check the colors.

    In Visual Studio 2017 Internet Builder, the properties of my Launch Screen background are #093254:
    R: 9 G: 50 B: 33

    I can screenshot the preview window (insuring the background is not selected) and use Photoshop's eyedropper to confirm it's the right color (compared both Hex and RGB values).

    The source code for the background color is as follows:
    <color key="backgroundColor" colorSpace="calibratedRGB" red="0.035294117647058823" green="0.19607843137254902" blue="0.32941176470588235" alpha="1"/>
    And I double-checked that math.

    I then uninstalled the app from the physical phone, restarted the phone and reinstall the app to avoid any Launch Screen caching.

    And still not getting the right background color on the Launch Screen background.

    A few more notes:
    1) It seems the darker the background color, the more off the color is.
    2) Prior to using a Storyboard, we used a launch image (png) and the colors always matched then so this might be related to Storyboard Launch Screen.

  • JohnMillerJohnMiller Xamurai USForum Administrator, Xamarin Team Xamurai

    @JimKoehler,

    That scenario does sound worrying. Can you confirm you notice the same behavior when deploying directly from Visual Studio for Mac instead of from Windows? If that's not possible, instead clear the build cache on the Mac before doing a rebuild on Windows.

  • JimKoehlerJimKoehler ✭✭ USMember ✭✭
    1. Trashed the mtbs folder in ~/Library/Caches/Xamarin
    2. In Visual Studio on Windows, solution Clean and Build
    3. In Visual Studio on Mac, solution Clean and Build

    Still see a color difference on both a physical iPhone and iPhone simulators.

    We have submitted this as a bug:
    https://github.com/xamarin/Xamarin.Forms/issues/1750

  • LobboLobbo ✭✭ GBMember ✭✭

    Was there a solution to this?

  • ilkenginilkengin Member

    Hi,

    I am facing this issue as well. I have an image with a straightforward color and some other stuff on it and I want to put the same color to the window background to match it with the one in the image. However, when I run my app the color on the image and the background does not match.

    I took a screenshot and see if it is the same as I gave, but it is different. I saw the Screenshot on mac as well, it is absolutely different.

    I tried to use different color spaces as calibratedRGB, sRGB etc. They did not work!

    Pls, help!

  • masandrewmasandrew ✭✭ Member ✭✭

    Has anyone resolved this issue? I have a color noted in splash screen for IOS which is the same color i use in different pages in my app and the splash screen appears to be muted. There is no tint noted as well.

  • JGoldbergerJGoldberger Xamurai USMember, Forum Administrator, Xamarin Team, University Xamurai
  • FilipePlucenioFilipePlucenio Member

    @JimKoehler said:
    I'm also having the same problem as @JamesFormica and @PatrickLong. And I don't think it's how different displays show colors different as @JGoldberger suggested since I'm relying on tools and not my eyes to check the colors.

    In Visual Studio 2017 Internet Builder, the properties of my Launch Screen background are #093254:
    R: 9 G: 50 B: 33

    I can screenshot the preview window (insuring the background is not selected) and use Photoshop's eyedropper to confirm it's the right color (compared both Hex and RGB values).

    The source code for the background color is as follows:
    <color key="backgroundColor" colorSpace="calibratedRGB" red="0.035294117647058823" green="0.19607843137254902" blue="0.32941176470588235" alpha="1"/>
    And I double-checked that math.

    I then uninstalled the app from the physical phone, restarted the phone and reinstall the app to avoid any Launch Screen caching.

    And still not getting the right background color on the Launch Screen background.

    A few more notes:
    1) It seems the darker the background color, the more off the color is.
    2) Prior to using a Storyboard, we used a launch image (png) and the colors always matched then so this might be related to Storyboard Launch Screen.

    I found a formula that solved my problem. Using the values ​​in RGB but dividing by 255

    R: 9/255 = 0,0352941176470588
    G: 50/255 = 0,196078431372549
    B: 33/255 = 0,1294117647058824

    That solved my problem.

  • ClayBrinleeClayBrinlee ✭✭ USMember ✭✭

    After wasting a ton of time thinking my settings were still wrong when testing on a real device, they weren't. I found that no matter how many times I cleaned and rebuilt and uninstalled the app off the device and re-deployed it still wasn't showing my lastest changes. How did I know this? Because I completely changed the image I was using but it kept showing the old image. For giggles I uninstalled the app and restarted the ios device. After re-deploying everything was great.

Sign In or Register to comment.