Swiftpack.co - Package - ChimeHQ/Dusk

Github CI Carthage compatible


Dusk is a small framework to aid in supporting Dark Mode on macOS. It is particularly useful for applications that use full-window theming, or need to support earlier OSes.

This project was made much easier thanks to the hard work of two people.

Paulo Andrade's post about Adopting Dark Mode and Older Macs was great for understanding how to subclass NSColor.

Daniel Jalkut published a fantastic series about adopting Dark Mode on macOS. Many of the ideas, and even some of the code he presented, have found their way into this project.



github "ChimeHQ/Dusk"

Swift Package Manager:

dependencies: [
    .package(url: "https://github.com/ChimeHQ/Dusk.git")



A handy NSColor subclass that makes it easier to use dynamic colors when you aren't able to store colors in asset catalogs. It provides two APIs, one that mimics NSColor(name:dynamicProvider:), and another that let's you more easily define a light and dark variant of an NSColor instance.

DynamicColor(name: "uniqueColorName") { (appearance) in 

DynamicColor(name: "uniqueColorName", lightColor: NSColor.white, darkColor: NSColor.black)


A very simple class that will observe effective appearance changes and post a notification when triggered. Useful when created within an NSApplication delegate for application-wide notifications.

NSAppearance Extensions




NSAppearance.withCurrent(.aqua) {

Suggestions or Feedback

We'd love to hear from you! Get in touch via twitter, an issue, or a pull request.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.


Stars: 13


Used By

Total: 0


v1.1.1 - 2020-02-07 02:16:51

  • small documentation improvements

v1.1.0 - 2019-11-02 19:04:45

  • DynamicColor
  • More NSAppearance conveniences
  • Much better testing

v1.0.0 - 2019-06-02 18:03:11

First Release!