maui icon indicating copy to clipboard operation
maui copied to clipboard

When an image is used for a IconImageSource all images are using the theme or a different color than the one originally assigned in the .svg after that

Open pierre01 opened this issue 10 months ago • 1 comments

Description

if an image imge1.svg is referenced by an IconImageSource as image1.png its color is adapted to the theme (dark or white). Unfortunately if you used the same image in a list item for instance then all the other images referencing image1.png in a template or image button are now using the new color, Not the original color defined in the svg.. NOTE: Works fine on iOS

Steps to Reproduce

if an image imge1.svg is referenced by an IconImageSource as image1.png its color is adapted to the theme (dark or white) but all the other images referencing image1.png in a template or image button are now using the Icon source color, not the original color.

  1. create a image.svg file with a blue color.
  2. create a template for a listItem in a list control using an image referencing image.png
  3. Use a swipeView with a swipeItem using the same image for its IconImageSource="image.png"
  4. notice that after using the swipeview, the images of your list items gets the same color.

IconColor

ImageColor

Link to public reproduction project repository

No response

Version with bug

8.0.20 SR4

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

Create a duplicate .svg image for IconImageSource

Relevant log output

No response

pierre01 avatar Apr 16 '24 07:04 pierre01

Here

Hi @pierre01. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

Here is the repo that reproduces it:

https://github.com/pierre01/IconImageSourceBug

pierre01 avatar Apr 18 '24 11:04 pierre01

Verified this issue with Visual Studio 17.10.0 Preview 4(8.0.20). Not repro on android platform with sample project. maui2

kevinxufei avatar Apr 19 '24 07:04 kevinxufei

Hi @kevinxufei those are not the original colors please notice how the original icons are blue to start with and should not change to white.... but yes when all icons are set to white nothing new happens. Look closely at the screen when you start. There is no reason that the template icons change color based on the swipeview bottons color

https://github.com/dotnet/maui/assets/2603287/d48685ec-2cd9-4cf1-8205-8a5e9c845a07

pierre01 avatar Apr 19 '24 12:04 pierre01

Tried with the latest! Still the issue is there. there is no reason the image buttons in my UI turn from purple to white after using the swipeView

pierre01 avatar Apr 19 '24 12:04 pierre01

Thank you for your reply. I can repro this issue!

kevinxufei avatar Apr 22 '24 01:04 kevinxufei