Finder tag colors and folder icons become gray for iCloud Drive items (URLResourceValues / xattr / QLThumbnailGenerator)

Hi,

I’m working on a macOS app that includes a file browser component. And I’m trying to match Finder’s behavior for color tags and folder icons.

For local files/folders everything works fine:

  • Tag color key returns the expected label number via
NSColor * labelColor = nil;
[fileURL getResourceValue:&labelColor forKey:NSURLLabelColorKey error:nil];

NSNumber * labelKey = nil;
[fileURL getResourceValue:&labelKey forKey:NSURLLabelNumberKey error:nil];
  • QLThumbnailGenerator obtains the expected colored folder icon (including emoji/symbol overlay if set) via
QLThumbnailGenerationRequest * request =
[[QLThumbnailGenerationRequest alloc] initWithFileAtURL:fileURL
                                                   size:iconSize
                                                  scale:scaleFactor
                                    representationTypes:QLThumbnailGenerationRequestRepresentationTypeIcon];
request.iconMode = YES;

[[QLThumbnailGenerator sharedGenerator] generateBestRepresentationForRequest:request
                                                           completionHandler:^(QLThumbnailRepresentation * _Nullable thumbnail, NSError * _Nullable error) {
    if (thumbnail != nil && error == nil)
    {
        NSImage * thumbnailImage = [thumbnail NSImage];
        
        // ...
    }
}];

However, for items on iCloud Drive (whether currently downloaded locally or only stored in the cloud), the same code always produces gray colors, while Finder shows everything correctly:

  • NSURLLabelNumberKey always returns 1 (gray) for items with color tags, and 0 for non-tagged.
  • Folder icons returned via QLThumbnailGenerator are gray, no emoji/symbol overlays.
  • Reading tag data from xattr gives values like “Green\1” (tag name matches, but numeric value is still "Gray").

Also, if I move a correctly-tagged local item into iCloud Drive, it immediately becomes gray in my app (Finder still shows the correct colors).

Question:

What is the supported way to retrieve Finder tag colors and the correct folder icon appearance (color + overlays) for items in iCloud Drive, so that the result matches Finder?

I am on macOS Tahoe 26.2/26.3, Xcode 26.2 (17C52). If you need any additional details, please let me know.

Thanks!

I can reproduce with my own code that moving a folder tagged with a color to iCloud Drive indeed changes the value of the .labelColorKey and .labelNumberKey resources, which is a surprise to me. .tagNamesKey returns the right value though.

Do you have a feedback report yet? If not, would you mind to file one and share your report ID here?

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Thanks!

Feedback report sent - ID: FB21946632

Tag names can be used, but they’re locale-dependent, so there’s no reliable way to convert them into a stable color key (please correct me if I’m wrong).

This also doesn’t address the icon issue: iCloud Drive folders turn gray for any color tint, which defeats quick visual identification.

This affects all 3rd-party apps and seems to originate in macOS 14 Sonoma (possibly earlier).

Finder tag colors and folder icons become gray for iCloud Drive items (URLResourceValues / xattr / QLThumbnailGenerator)
 
 
Q