I have a chart in SwiftUI built using Swift Charts.
The sector marks of this chart should update their color according to the color scheme (e.i. Dark/Light mode).
The same view updates its colors correctly in the app but doesn't update its colors correctly in the widget (keeps light mode colors).
The rest of the views in the widget are updated as expected, the problem is only with the widget's sector marks.
Chart(items) { sectorMark in
SectorMark(
angle: .value(
Text(verbatim: sectorMark.id.rawValue),
sectorMark.whatever
)
)
.foregroundStyle(Color(uiColor: .label) // This is an example of a color that changes in dark mode.
}