title: Detect dark mode in macos from python
body: <p>I am writing a PyQt app and I have to add a patch so that the font is readable on macos with dark mode enabled:</p>
  
  <pre><code>app = QApplication([])
  # Fix for the font colours on macos when running dark mode
  if sys.platform == 'darwin':
      p = app.palette()
      p.setColor(QPalette.Base, QColor(101, 101, 101))
      p.setColor(QPalette.ButtonText, QColor(231, 231, 231))
      app.setPalette(p)
  main_window = MainWindow()
  main_window.show()
  app.exec_()
  </code></pre>
  
  <p>The issue with this patch is then it makes things unreadable on macos with light mode.</p>
  
  <p>Is there a way I can detect dark mode on macos from python or using a standard shell command through subprocess?</p>
  
  <p>EDIT:
  As of PyQt 5.12 the dark mode fix is no longer required.</p>