Also for the record... from Qt6.5 on, there's no need to do much of anything special for plugins to match the system colors/theme. Just add app.setStyle('Fusion') somewhere appropriate and your plugin will match your system colors/theme (and will even change on the "fly"). To my knowledge, system theme matching has worked with PySide6 apps on Linux and macOS without needing to specify app.setStyle('Fusion') for some time (Fusion is default on Linux, and macOS uses a different dark capable theme). But it's definitely still needed on Windows (which defaults to another style).
There should be no need to check for a system dark theme on any platform. If you make Sigil 2.0 the minimum for your plugin, you should be able to just add app.SetSyle('Fusion') to your code and PySide6 theming (including on the fly theming) will take care of itself. I wouldn't set the style to Fusion on macOS, but something like the following should work across the board:
Code:
_plat = sys.platform.lower()
iswindows = 'win32' in _plat or 'win64' in _plat
if iswindows:
app.setStyle('Fusion')
I bypassed the match_dark_palette feature of my plugin_utils module and this just works on all platforms. So no need to use my module just to match system themes.