To change the app color theme in Windows 10, you can edit the registry using these commands:
Dark Theme:
reg.exe add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize /v AppsUseLightTheme /t REG_DWORD /d 0 /f
Light Theme:
reg.exe add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize /v AppsUseLightTheme /t REG_DWORD /d 1 /f
Switching to dark mode in Python can be achieved using the subprocess package as follows:
import subprocess
command = ['reg.exe', 'add', 'HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize',
'/v', 'AppsUseLightTheme', '/t', 'REG_DWORD', '/d', '0', '/f']
subprocess.run(command)
The arguments for run must be passed in a list. To change to light mode the same code works but you just replace the command with the command to change to light mode.
I hope this answer helps.