I just played around on macOS with the new icons created by Icon Composer, and I noticed that the Dock displays programmatically set icons differently. Try this:
- Make sure you have the Mail app in your Dock.
- Set the icon appearance to "Tinted/Light" and set a dark (black) background for the Desktop.
- Run this code:
let image = NSWorkspace.shared.icon(forFile: "/System/Applications/Mail.app")
if image.isValid { NSApp.applicationIconImage = image }
- You'll get something like this:
When the icon appearance is set to "Default" or "Dark," everything works as expected, and the "Clear/Dark" and "Tinted/Dark" modes seem to work as well. It seems like the Dock uses a special blend mode depending on the selected background, but this does not seem to be the case if the icon is set programmatically. I filed feedback FB20291186.