Questions tagged [macos-darkmode]

Dark Mode is a feature introduced in macOS Yosemite that changes the primary color scheme of the operating system to one that features light text on dark backgrounds instead of the traditional dark text on light backgrounds. Use this tag for questions specifically related to detection and issues stemming from the use of Dark Mode on macOS as opposed to general light-on-dark color scheme questions.

First introduced in macOS Yosemite and further refined in macOS Mojave, Dark Mode enables uses to toggle the environment design of the operating system to a color scheme that features light text on dark backgrounds as opposed to dark text on light backgrounds.

Apple describes this as "a dramatic new look that's easy on your eyes and helps you focus on your work."

Modern software can detect the presence and use of Dark Mode to allow developers to display their software in a design that matches the aesthetics of other Dark Mode apps.

55 questions
1
vote
1 answer

Write SDK version to binary when compiling from command line (macOS)

I am trying to detect whether the system is in dark mode. I have already tried reading AppleInterfaceStyle from the user defaults i.e. NSString *interfaceStyle = [[NSUserDefaults standardUserDefaults] stringForKey:@"AppleInterfaceStyle"]; …
weisj
  • 932
  • 6
  • 19
1
vote
1 answer

NSAppearanceNameAqua is returned both in dark and light mode

I have an application in Qt for mac and after upgrading to XCode 11.4, my application does not switches to dark mode. I checked out my code and I realized that NSAppeareance name is NSAppearanceNameAqua both in case of light and dark mode. I tried…
willy
  • 487
  • 5
  • 21
1
vote
0 answers

SVG dark mode styling doesn't work in Safari

Site body dark mode styling works well on both Chrome and Safari for me by CSS variables with prefers-color-scheme. But there is a different situation with logo. I've styled external .svg inside of it with styling for dark mode and light mode, which…
1
vote
0 answers

PDFView's effectiveAppearance not updated when switching to dark mode

PDFKit's PDFView seems to not be compatible with dark mode. It's effectiveAppearance does not get updated when user switches to dark mode. override public func updateLayer() { print("mode = \(effectiveAppearance.name)") …
vomi
  • 993
  • 8
  • 18
1
vote
1 answer

Swift Command Line Tool Not Receiving DistributedNotificationCenter Notifications

I am trying to create a very basic Swift command-line application that signals to another application using a WebSocket when the macOS UI changes to/from light/dark mode. For some reason, the command-line tool is not receiving any notifications from…
1
vote
1 answer

Java 8 application not working correctly with dark mode on MacOS Catalina 10.15

If the user switches System Preferences:General:Appearance to Dark the main screen (a JFrame) of my application goes from to So clearly Java recognises that Dark mode has been selected but doesn't do a very good job of adjusting accordingly. The…
Paul Taylor
  • 13,411
  • 42
  • 184
  • 351
1
vote
1 answer

How to use cookies to run "oneClick"

My website has two main features: first it supports the dark mode with/and without macOS/iOS (there is a toggle on the website) and I use different tabs with javascript as translations of the website. Now I want to have the function, to save/get a…
1
vote
0 answers

NSRequiresAquaSystemAppearance and pref panes

I have a System Preferences Pane that always opens in the light appearance mode when running in 10.14. Normal apps compiled in earlier system can use dark mode by including a plist parameter: NSRequiresAquaSystemAppearance = NO. However, when I add…
Trygve
  • 1,317
  • 10
  • 27
1
vote
3 answers

macOS Dark Mode UI bugs with NSPredicateEditor in a Sheet

In a Mac app, I am presenting a sheet containing an NSPredicateEditor: parentViewController.presentAsSheet(predicateEditor) I created a sample project for this behavior here: https://github.com/pkamb/Feedback_NSPredicateEditor In macOS 10.14 Mojave…
pkamb
  • 33,281
  • 23
  • 160
  • 191
1
vote
0 answers

How to disable transparency in NSView?

I have a simple status bar app using NSPopover that I'd like to support Mojave Dark Mode. If I use the recommended semantic colors it looks fine in most cases light and dark, unless there's a bright window behind it, in which case the window…
Eric McNeill
  • 1,784
  • 1
  • 18
  • 29
1
vote
1 answer

Dark mode Mac OS

I received this error from Apple at the time of publication of my application. how can I solve this problem? We found that when Dark Mode is enabled, the menu bar extra icons aren't visible. I can not find anything online to define Dark mode...
user9988661
0
votes
0 answers

NSImage does not Change for Light/Dark Appearances

I am developing a Mac Cocoa app. And I have a set of images to adopt for both light and dark modes. I followed the instructions here: https://developer.apple.com/documentation/uikit/uiimage/providing_images_for_different_appearances In…
Wendell
  • 474
  • 3
  • 12
0
votes
1 answer

Is there a way to force Dark Mode on a website on macOS for Safari?

I've attempted @media (prefers-color-scheme dark) but it doesn't seem like that works for macOS on Safari? Works just fine on iOS Safari so I'm kind of confused. Is there a way to create like a fallback in case that doesn't work and the page…
jasonhe
  • 134
  • 12
0
votes
3 answers

Rendering Maps on devices where Dark Mode has been selected

I am rendering OSM map tiles onto a web page using HTML canvas drawImage. However where an end user has selected dark mode, I would like to reduce the luminosity of these displayed maps, yet still allow them to make sense to the user. So far I have…
0
votes
3 answers

how to restrict your app in light mode when Device is in Dark Mode for IOS 13

in your app Delegate. Just go to the func: func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { if #available(iOS 13.0, *) { …