colorScheme value always dark after setting dark mode in display and brightness even if Home Screen customization is light

If you set the display and brightness settings in iOS to be in dark mode, then the value returned in the colorScheme environment value:

https://developer.apple.com/documentation/swiftui/environmentvalues/colorscheme

@Environment(.colorScheme) var colorScheme

is always dark, even if you toggle between light or dark in the Home Screen customization option. Tinted is reported correctly.

Is there some way to get the Home Screen customization light/dark/tinted value correctly? Swapping the Home Screen customization value between light/dark does swap between the light and dark app icon so it seems like the widget color scheme should also swap in this case.

@markdaws Are you referring to the App icon or the systemwide appearance?

The reason I ask this is because within the HomeScreen you can customize the appearance of app icons to light, dark, or tinted and toggle the systemwide appearance.

However systemwide appearance can only toggle on and off between light or dark appearance and @Environment(.colorScheme) var colorScheme would return the display value for the system wide appearance and not the App icons.

I have also problem understanding how this is supposed to work. How should a widget that supports light/dark theme be updated? If using the colorScheme then it will not be in sync with the home screen's light/dark. The home screen's light/dark theme seems not accessible to the widget.

It seems a bit odd if widgets are supposed to follow the system's theme while the icons follows the home screen's theme. Furthermore, I know that at some point it worked in a more logical manner, but seems to have changed close to release of iOS 18.

colorScheme value always dark after setting dark mode in display and brightness even if Home Screen customization is light
 
 
Q