cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
creatiiive
Microsoft
Microsoft

Greying out unselected images in gallery. Like transparency but for saturation.

I have a gallery that is populated with a list of items coming from an excel source. I have this in the Transparency property of the first item in the gallery(applicable to all items).

 

 

If(ThisItem.IsSelected, 0,0.4)

 

 

I get the exact thing I want but rather than the Transparency of those images being faded as they are not selected I would like to have the saturation of the colors to 0 (aka, grey scale icons). How would this be achievable ?

 

PS, my items are only displayed with a logo from the excel sheet(link), so no other info but an icon is to select from.

Thank you !

 

1 ACCEPTED SOLUTION

Accepted Solutions
NuttyPistons
Super User
Super User

I don't believe there's a way to change the saturation on an uploaded image. Another option would be to separately upload two images of each logo -- one in greyscale and one in full colour -- and then set 'Visible' on the Greyscale image to !ThisItem.IsSelected and set 'Visible' on the colour image to ThisItem.IsSelected.

View solution in original post

3 REPLIES 3
NuttyPistons
Super User
Super User

Hi @creatiiive ,

Instead of changing the image transparency -- what you can do is put a rectangle (from icons) in front of the image and then change the 'Fill' of that rectangle based on whether or not that item is selected. For example, you could use this code for the Rectangle Fill:

RGBA(0, 0, 0, If(ThisItem.IsSelected, 0, 0.75))

 

This is still changing transparency, but might achieve the effect that you're after.

Screenshot 2021-11-22 152424.png
This is the result, which is not a greyscale of icons. 
The image below is what i want to do.

Screenshot 2021-11-22 152648.png

NuttyPistons
Super User
Super User

I don't believe there's a way to change the saturation on an uploaded image. Another option would be to separately upload two images of each logo -- one in greyscale and one in full colour -- and then set 'Visible' on the Greyscale image to !ThisItem.IsSelected and set 'Visible' on the colour image to ThisItem.IsSelected.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (2,959)