For Apple Watch complications displayed on tinted faced, developers can use:
@Environment(\.complicationRenderingMode) var renderingMode
to see if the watch face is tinted. You can then use the
.complicationForeground()
modifier to set elements of the complication to match that tint color. (I appreciate that
.complicationForeground()
is now deprecated in favour of
.widgetAccentable()
but I believe the behaviour is the same).
However, this can only be applied to a view I believe. I'd like to display a Swift Chart where only certain elements of the chart have the
.complicationForeground()
rather than the whole chart.
For example, in one case I'd like the LineMark to pop with the tinted color of the complication whilst the rest of the complication get the gray default tint.
Is there a way to do with with the current APIs?
Thanks
Have come up with a solution.... someone will probably tell me it's horrible, buts it's my only idea for now.
I used a ZStack so when the complicationRenderingMode == .tinted I overlay another chart with complicationForeground() modifier applied to the whole thing. On that chart I then only include the elements I want to be tinted. The base chart then offers the elements I want in grey. Hope this helps someone, will update if I find a better solution.