App icon color not changing dynamically according to background color from Ventura onwards

In my Swift app for MacOS, I used to set the app icon in status bar with following logic.

  1. If dark mode is enabled, white colour template icon
  2. If light mode is enabled, black colour template icon

Until BigSur with this configuration, if the background wallpaper color was changed being in the same display mode, the status bar icon color used to change dynamically.

From Ventura onwards, it does not depend on the background colour anymore with same configuration in the code. Can someone please help here?

App icon color not changing dynamically according to background color from Ventura onwards
 
 
Q