Skip to main content

Detect macOS Mojave Dark Mode from Python

Project description

Darkdetect

This package allows to detect if the user is using Dark Mode (macOS 10.14+ or Windows 10 1607+). The main application of this package is to detect the Dark mode from your GUI Python application (Tkinter/wx/pyqt/qt for python (pyside)/...) and apply the needed adjustments to your interface. Darkdetect is particularly useful if your GUI library does not provide a public API for this detection (I am looking at you, Qt). In addition, this package does not depend on other modules or packages that are not already included in standard Python distributions.

Usage

import darkdetect

>>> darkdetect.theme()
'Dark'

>>> darkdetect.isDark()
True

>>> darkdetect.isLight()
False

It's that easy.

Install

The preferred channel is PyPI:

pip install darkdetect

Alternatively, you are free to vendor directly a copy of Darkdetect in your app. Further information on vendoring can be found here.

Notes

  • This software is licensed under the terms of the 3-clause BSD License.
  • This package can be installed on any operative system, but it will always return None unless executed on a version of macOS or Windows that supports Dark Mode. This package is designed to work also with older versions of macOS and Windows and in those cases it will also return None. Detection of the dark menu bar and dock option (available from macOS 10.10) is not supported.
  • Details on the detection method used on macOS.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

darkdetect-0.2.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

darkdetect-0.2.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file darkdetect-0.2.0.tar.gz.

File metadata

  • Download URL: darkdetect-0.2.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for darkdetect-0.2.0.tar.gz
Algorithm Hash digest
SHA256 dd9f04d39a9f6b45456af579cc688ee4a3e9ebadd6db9022712549244584d837
MD5 3e13f698d527d4e1b23bf96b51c616f3
BLAKE2b-256 5ff6d54627f1d3d31f88ca68a85e34c4079dfded490c198ad2a3623aeac546ff

See more details on using hashes here.

File details

Details for the file darkdetect-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: darkdetect-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for darkdetect-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3b0e90b6e4e2d8e10bf45a87de110a7a23faa9ca04e41721eee31a271a152ecf
MD5 8289853c80c17d78da347fd339f2ee55
BLAKE2b-256 e8ba52a410bc972324dfd29920cb86aca9d1b478d97fa6c74c71f49f939abfb4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page