Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS Splash background color is wrong #9405

Closed
davidortinau opened this issue Aug 13, 2022 · 24 comments · Fixed by #10549
Closed

iOS Splash background color is wrong #9405

davidortinau opened this issue Aug 13, 2022 · 24 comments · Fixed by #10549
Labels
area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer fixed-in-7.0.0-rc.2.6866 Look for this fix in 7.0.0-rc.2.6866! platform/iOS 🍎 t/bug Something isn't working

Comments

@davidortinau
Copy link
Contributor

Description

I'm not sure if this only shows up on certain displays, but the generated RGB that ends up in the MauiSplash.Storyboard doesn't match the hex value provided in the csproj.

From csproj:

<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />

From MauiSplash.Storyboard:

<color key="backgroundColor" red="0.31764707" green="0.16862746" blue="0.83137256" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>

Color picking in Photoshop this is #5729dd which is not #512BD4 and at least on my display is obviously wrong.

Simulator Screen Shot - iPhone 13 Pro - 2022-08-13 at 12 37 56

Steps to Reproduce

File > New and run on iPhone 13 Pro sim. My display settings:

image

Version with bug

6.0.486 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

15

Did you find any workaround?

No response

Relevant log output

No response

@davidortinau davidortinau added the t/bug Something isn't working label Aug 13, 2022
@KSemenenko
Copy link
Contributor

I have the same issue #9443

@KSemenenko
Copy link
Contributor

KSemenenko commented Sep 1, 2022

Screenshot 2022-09-01 at 16 34 04

Also there is no icon at all

<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#ED2C65" BaseSize="128,128" />

or

<MauiSplashScreen Include="Resources\Splash\splash.svg" TintColor="#ED2C65" Color="#ED2C65" BaseSize="128,128" />

@FirewizzNL
Copy link

I have got the same issue, I use a svg image with transparent background, but it still generates another color:
image
image
image

@KSemenenko
Copy link
Contributor

KSemenenko commented Sep 6, 2022

About disappearing pictures.

When I changed params they are works fine for simulator

<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#ED2C65"  />
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#ED2C65" BaseSize="128,128" />   // but no difference

But it looks the same.
Screenshot 2022-09-06 at 19 05 47

so it looks like the splashscreen is not re-generated after changing the parameters.

@KSemenenko
Copy link
Contributor

And it’s not working on AzureDevOps, so I still have empty rectangle

@FirewizzNL
Copy link

For me, when I used different content/image it helped to remove the bin and obj folder from my project.
But I think the svg is re-rendered different than the background itself causing the difference in color. I think the transparent background of the svg is replaced with the background color and rendered so that it changes color slightly and getting a bit dull of color as seen in both our projects.

@KSemenenko
Copy link
Contributor

One more observation. SplashScreen works differently for different devices.
For iPads and small screens I see my SplashScreen as it should. but on the iPhone 13 Pro Max it does not. only an empty square of the wrong color.

@KSemenenko
Copy link
Contributor

KSemenenko commented Sep 9, 2022

For me, when I used different content/image it helped to remove the bin and obj folder from my project.
But I think the svg is re-rendered different than the background itself causing the difference in color. I think the transparent background of the svg is replaced with the background color and rendered so that it changes color slightly and getting a bit dull of color as seen in both our projects.

Your advice helped, I removed the transparent background and the logo appeared on devices with small screens.

more updates:
I rename splash.svg to another name, and now it's appear.

@FirewizzNL
Copy link

But someone fixed the color difference on the image/backgound?

@KSemenenko
Copy link
Contributor

nope, color is still not ok

@FirewizzNL
Copy link

Someone with a workaround or any progress on this? Looks quite flimsy like this when releasing.

@e1T
Copy link

e1T commented Sep 20, 2022

I'm experiencing the same issue. One workaround might be to convert the svg to png manually and use that png as splash screen, but obviously this diminishes the advantage of using svg.

@KSemenenko
Copy link
Contributor

I'm experiencing the same issue. One workaround might be to convert the svg to png manually and use that png as splash screen, but obviously this diminishes the advantage of using svg.

Background color is the issue

@Eilon Eilon added the area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer label Sep 23, 2022
@KSemenenko
Copy link
Contributor

Any updates? Will it be fixed in .net 7?

@KSemenenko
Copy link
Contributor

KSemenenko commented Oct 4, 2022

More details here - it's issue with icon generator
Screenshot 2022-10-04 at 09 41 31

@KSemenenko
Copy link
Contributor

@FirewizzNL for fast solution you can change your background for SPlashScreen for icon background color.
<MauiSplashScreen Include="Resources\Splash\splashscreenwitnk.svg" Color="#DB446A" Resize="true" BaseSize="128,128" />

@iagocc-wapping
Copy link

Hello,
I have the same issue in iOS devices, tried a lot of things the color difference is still there while using .svg.
@KSemenenko the fast solution that you mention resolves this issue? I tried setting the color in the MauiSplashScreen, and changes the background but the problem persists.

@KSemenenko
Copy link
Contributor

KSemenenko commented Oct 4, 2022

@iagocc-wapping yes, so my steps

  1. create svg with background color.
  2. Add splash screen and background color:
    <MauiSplashScreen Include="Resources\Splash\splashscreenwitnk.svg" Color="#DB446A" Resize="true" BaseSize="128,128" />
  3. make screenshot of SplashScreen
  4. pick icon background color (it will be different, because of issue with image generator.
  5. replace splashscreen background color with color form icon background.

then you will have little bit different color, but it will looks ok.

so, issue is - wrong icon background color, and should use iconbackgrd colorer (after generation of images) for SplashScreen background

@beeradmoore
Copy link
Contributor

Won't this then be broken on Android as you are explicitly using two different colours as this issue is iOS only?

@KSemenenko
Copy link
Contributor

Won't this then be broken on Android as you are explicitly using two different colours as this issue is iOS only?

you can do like this

<ItemGroup Condition="$(TargetFramework.Contains('-ios'))">
      <!-- App Icon -->
      <MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\ios.svg" Color="#ED2C65" />
  </ItemGroup>

  <ItemGroup Condition="$(TargetFramework.Contains('-android'))">
      <!-- App Icon -->
      <MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\android.svg" Color="#ED2C65" />
  </ItemGroup>
  

@beeradmoore
Copy link
Contributor

Oh, true. Thanks.

@mattleibow
Copy link
Member

For the splash not updating, it is more a device/simulator issue because the OS seems to be caching things: #8685

@mattleibow
Copy link
Member

mattleibow commented Oct 7, 2022

I am going to look and see why the image has the incorrect color - I see it in the .NET splash so I can reproduce.

But, I am also going to investigate NOT drawing a background color on the bitmap - so it will remain a transparent image. Unless this will cause other issues.

One issue is that if you use the same image for the icon and the splash, it will have the same filename - for example "appicon" for the MauiIcon and the MauiSpashScreen. As a result, the icon may set a color anyways. Basically these issues:

I think best practice would be to make sure you don't have images with the same name being used for multiple things - like icons, images and splash.

@KSemenenko
Copy link
Contributor

KSemenenko commented Oct 7, 2022

also app icons for iOS and Android have different size

@ghost ghost locked as resolved and limited conversation to collaborators Nov 7, 2022
@samhouts samhouts added the fixed-in-7.0.0-rc.2.6866 Look for this fix in 7.0.0-rc.2.6866! label Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer fixed-in-7.0.0-rc.2.6866 Look for this fix in 7.0.0-rc.2.6866! platform/iOS 🍎 t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants