Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dark mode icons #41

Closed
lgarron opened this issue Jun 27, 2020 · 14 comments
Closed

Dark mode icons #41

lgarron opened this issue Jun 27, 2020 · 14 comments
Labels

Comments

@lgarron
Copy link
Owner

lgarron commented Jun 27, 2020

macOS uses darker folder icons for dark mode. I don't think it's possible to set a dynamic icon for a folder that switches between them, but a user who has permanent dark mode might want to use it, and a daemon could also switch known folders at transition time.

@lgarron
Copy link
Owner Author

lgarron commented Nov 16, 2020

Note: on Big Sur, the dark icons are much more similar to the light icons.

@cfwongfreeman
Copy link

In Mojave, folder icon looks very different in two modes. A new option "-dark" may be very helpful.

@ghost
Copy link

ghost commented Feb 15, 2021

this would be very useful, i don't think it'd be that hard to do assuming its just changing the icon files on which the user's image is engraved. i've tried to manually replace the icons at /usr/local/Cellar/folderify/2.1.1/libexec/lib/python3.9/site-packages/folderify/GenericFolderIcon.BigSur.iconset but it didnt seem to work even after using python3 /usr/local/Cellar/folderify/2.1.1/libexec/lib/python3.9/site-packages/folderify/__main__.py to invoke the program, maybe its hardcoded somehow? the difference is minimal on big sur but because of my dock layout i have a custom folder right next to the the pictures folder and its slightly infaturating. i could commit to it but i dont know anything about the repo soo.. also changing the icons between dark and light mode should be possible, just need to figure out how macos itself does it and kinda trick it to do it for custom folders too but it might require SIP off or something so idk

@lgarron
Copy link
Owner Author

lgarron commented Feb 16, 2021

Copying from an email:

It's definitely possible to generate dark mode icons, and at some point I would like to: #41
It's a little tricky, though, because users can switch from dark to light (automatically or manually) and I'm not aware of an easy way to switch file icons automatically. But we can at least generate the icons.

I don't know when I would get around to it, but I could use help:

  • Getting the dark mode template folders from the OS.
  • Tweaking the hardcoded colors in
    FILL_COLORIZED = colorize("2.1_FILL_COLORIZED", "rgb(8, 134, 206)", SIZED_MASK)
    FILL = opacity("2.2_FILL", "0.5", FILL_COLORIZED)
    BLACK_NEGATED = negate("3.1_BLACK_NEGATED", SIZED_MASK)
    BLACK_COLORIZED = colorize("3.2_BLACK_COLORIZED", "rgb(58, 152, 208)", BLACK_NEGATED)
    BLACK_BLURRED = blur_down("3.3_BLACK_BLURRED", black_blur, black_offset, BLACK_COLORIZED)
    BLACK_MASKED = mask_down("3.4_BLACK_MASKED", "Dst_In", BLACK_BLURRED, SIZED_MASK)
    BLACK_SHADOW = opacity("3.5_BLACK_SHADOW", "0.5", BLACK_MASKED)
    WHITE_COLORIZED = colorize("4.1_WHITE_COLORIZED", "rgb(174, 225, 253)", SIZED_MASK)
    WHITE_BLURRED = blur_down("4.2_WHITE_BLURRED", white_blur, white_offset, WHITE_COLORIZED)
    WHITE_MASKED = mask_down("4.3_WHITE_MASKED", "Dst_Out", WHITE_BLURRED, SIZED_MASK)
    WHITE_SHADOW = opacity("4.4_WHITE_SHADOW", white_opacity, WHITE_MASKED)
  • Adding and using a --color-scheme flag. (Fortunately, it's easy to support a "current system" value using defaults read -g AppleInterfaceStyle).

@lgarron
Copy link
Owner Author

lgarron commented Feb 16, 2021

i've tried to manually replace the icons at /usr/local/Cellar/folderify/2.1.1/libexec/lib/python3.9/site-packages/folderify/GenericFolderIcon.BigSur.iconset

Ooh, where did you get the icons?

I've had trouble extracting the dark folder icons from anywhere on Big Sur.

@lgarron
Copy link
Owner Author

lgarron commented Feb 16, 2021

Looks like there are some versions at https://github.com/niem94/big-sur-folder-icons

@niem94, would you be willing to share how you found these?
(I'd like to extract them directly from the source to make 100% sure I have the right ones. There can be subtle color differences in conversion.)

@lgarron
Copy link
Owner Author

lgarron commented Feb 16, 2021

Aha!

https://github.com/insidegui/AssetCatalogTinkerer can extract files from /System/Library/PrivateFrameworks/IconFoundation.framework/Versions/A/Resources/Assets.car

It took me a while, but I found that info at https://developer.apple.com/forums/thread/657230?answerId=661120022#661120022

Thanks, @insidegui!

lgarron added a commit that referenced this issue Feb 16, 2021
lgarron added a commit that referenced this issue Feb 16, 2021
lgarron added a commit that referenced this issue Feb 16, 2021
Icons are extracted from
`/System/Library/PrivateFrameworks/IconFoundation.framework/Versions/A/Resources/Assets.car`
using https://github.com/insidegui/AssetCatalogTinkerer and minified
using ImageOptim.
@lgarron
Copy link
Owner Author

lgarron commented Feb 16, 2021

I don't think it's possible to set a dynamic icon for a folder that switches between them, but a user who has permanent dark mode might want to use it, and a daemon could also switch known folders at transition time.

I've filed #48 for that.

I'm closing this issue now that dark mode is implemented!

@devantler
Copy link

Aha!

https://github.com/insidegui/AssetCatalogTinkerer can extract files from /System/Library/PrivateFrameworks/IconFoundation.framework/Versions/A/Resources/Assets.car

It took me a while, but I found that info at https://developer.apple.com/forums/thread/657230?answerId=661120022#661120022

Thanks, @insidegui!

Thanks for sharing this. I've been asked a few times how i did it, but had forgotten in the meantime, and work have gotten in the way for me to research it a new. I will refer people to this answer :-)

@ghost
Copy link

ghost commented Feb 17, 2021

i've tried to manually replace the icons at /usr/local/Cellar/folderify/2.1.1/libexec/lib/python3.9/site-packages/folderify/GenericFolderIcon.BigSur.iconset

Ooh, where did you get the icons?

I've had trouble extracting the dark folder icons from anywhere on Big Sur.

i just used image2icon lol your source seems more reliable but i dont think the program actually uses those files anyway? idk bc the folder colours are still a little different

Screenshot 2021-02-17 at 10 06 34 AM

@lgarron
Copy link
Owner Author

lgarron commented Feb 17, 2021

i just used image2icon lol your source seems more reliable but i dont think the program actually uses those files anyway? idk bc the folder colours are still a little different

Screenshot 2021-02-17 at 10 06 34 AM

It looks like you're still using a light mode icon. Could you make sure you're on folderify v2.2.0 or later, and generate an icon using --color-scheme dark?

@ghost
Copy link

ghost commented Feb 17, 2021

i just used image2icon lol your source seems more reliable but i dont think the program actually uses those files anyway? idk bc the folder colours are still a little different
Screenshot 2021-02-17 at 10 06 34 AM

It looks like you're still using a light mode icon. Could you make sure you're on folderify v2.2.0 or later, and generate an icon using --color-scheme dark?

convert: unable to open image '/usr/local/Cellar/folderify/2.2.1/libexec/lib/python3.9/site-packages/folderify/GenericFolderIcon.BigSur.dark.iconset/icon_16x16.png': No such file or directory @ error/blob.c/OpenBlob/3537.
i didnt notice that folder either, just two versions of yosemite and one big sur
but i tried to replace them with the files i got from the assets, generate it again, and it seems to have worked, except the grave is a little lighter than normal, despite the image being pure black over transparent

Screenshot 2021-02-17 at 10 39 56 AM

lgarron added a commit that referenced this issue Feb 17, 2021
Thanks to
#41 (comment)
for pointing out that this was missing from the Python build.
@lgarron
Copy link
Owner Author

lgarron commented Feb 17, 2021

convert: unable to open image '/usr/local/Cellar/folderify/2.2.1/libexec/lib/python3.9/site-packages/folderify/GenericFolderIcon.BigSur.dark.iconset/icon_16x16.png': No such file or directory @ error/blob.c/OpenBlob/3537.

shakes fist at Python
I've tried publishing a fix in v2.2.2 to PyPI. Let me know if that works.

but i tried to replace them with the files i got from the assets, generate it again, and it seems to have worked, except the grave is a little lighter than normal, despite the image being pure black over transparent

Yeah, the dark icons have a darker main fill. v2.2.2 should take care of that for Big Sur folders when you pass --color-scheme dark.

@ghost
Copy link

ghost commented Feb 17, 2021

convert: unable to open image '/usr/local/Cellar/folderify/2.2.1/libexec/lib/python3.9/site-packages/folderify/GenericFolderIcon.BigSur.dark.iconset/icon_16x16.png': No such file or directory @ error/blob.c/OpenBlob/3537.

shakes fist at Python
I've tried publishing a fix in v2.2.2 to PyPI. Let me know if that works.

but i tried to replace them with the files i got from the assets, generate it again, and it seems to have worked, except the grave is a little lighter than normal, despite the image being pure black over transparent

Yeah, the dark icons have a darker main fill. v2.2.2 should take care of that for Big Sur folders when you pass --color-scheme dark.

oh yes it works now
i think they're p much the same tho, as expected, so i think the grave should be a little darker for dark mode

Screenshot 2021-02-17 at 9 19 42 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants