From 1479be0b1755e657b1de726bfb64bbe08e97b449 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Tue, 16 Apr 2019 14:29:47 -0700 Subject: [PATCH] doc: document occasional mismatch between NSImageName and string --- docs/api/native-image.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/api/native-image.md b/docs/api/native-image.md index 763249c7133ba..907242f0fa75a 100644 --- a/docs/api/native-image.md +++ b/docs/api/native-image.md @@ -198,6 +198,12 @@ The `hslShift` is applied to the image with the following rules This means that `[-1, 0, 1]` will make the image completely white and `[-1, 1, 0]` will make the image completely black. +In some cases, the `NSImageName` doesn't match its string representation; one example of this is `NSFolderImageName`, whose string representation would actually be `NSFolder`. Therefore, you'll need to determine the correct string representation for your image before passing it in. This can be done with the following: + +`echo -e '#import \nint main() { NSLog(@"%@", SYSTEM_IMAGE_NAME); }' | clang -otest -x objective-c -framework Cocoa - && ./test` + +where `SYSTEM_IMAGE_NAME` should be replaced with any value from [this list](https://developer.apple.com/documentation/appkit/nsimagename?language=objc). + ## Class: NativeImage > Natively wrap images such as tray, dock, and application icons.