Here you can see how .accessoryRectangular
look like for Color.accentColor multicolor
and red
.
There is a way how to fix it properly. But first I need to determine if user selected multicolor or not.
Since .accentColor
is defined the following not optional way:
public static var accentColor: Color { get }
is there any way to check if it is multicolor or not? I thought that multicolor is when accentColor is nil... but I was wrong. Any other ideas?
I wonder how are you able to get the current complication "accentColor" (I've ended up in your question because of that).
But for your original question, There's
WidgetRenderingMode
environment variable (since iOS 16 / watchOS 9).So you can switch based on it. Here is the snippet from the link below:
https://developer.apple.com/documentation/swiftui/environmentvalues/widgetrenderingmode