How to opt out of tinting widget content on visionOS

During the WWDC Session called "Design widgets for visionOS" the presenter says:

You can choose whether the background of your widget participates in tinting. If you opted out, for example to preserve a photo or illustration, make sure it still looks good alongside the selected color palette.

Unfortunately, this session has no example code. Can someone point me to the correct way to do this? Is there a modifier we can use on views?

(reposting this in the correct topic/subtopic)

Hello,

These articles

are a good starting point.

@DTS Engineer Can you please be specific? I don't see the answer to my question in either of those articles. How do tell visionOS not to apply a tint color to the background or content of my view? The WWDC session mentions opting out of this when displaying photos, but I don't see how to do that. How do I tell visionOS: "always render this image as it appears without ever trying to tint it."?

Hey @radicalappdev,

This is covered in What’s new in widgets. You can observe the widgetRenderingMode, and you can opt out images using the .widgetAccentedRenderingMode view modifier.

Hope this helps,
Michael

How to opt out of tinting widget content on visionOS
 
 
Q