Comments (9)
Never mind, I needed so much modifications that I ended up opening the project in XCode and doing lots of modifications to get my desired icons. I had to comment lots of lines so that it doesn't change other icons (mostly if (!image)
lines), I had to convert NSImage to CIImage and adjust brightness because icons in /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ are too sharp. and then convert it back to NSImage + some other minor modifications. Eventually I got my desired download icon (exactly looks like the native one
from colorfulsidebar.
Can you submit your modified config? I'd like to change some icons but not the defaults, too.
from colorfulsidebar.
@whoaitsaimz take a look at my fork and this commit: sassanh@8c01e78
from colorfulsidebar.
Note that on 10.9 I ran into this issue due to the use of TiffRepresentation. This is fixed by creating the CIImage from a CGImage directly instead of converting to the tiff intermediary:
NSImage * image = [[NSImage alloc] initWithContentsOfFile:key];
NSRect imageRect = NSMakeRect(0, 0, image.size.width, image.size.height);
CGImageRef cgImage = [image CGImageForProposedRect:&imageRect context:NULL hints:nil];
CIImage *ciImage = [[CIImage alloc] initWithCGImage:cgImage];
from colorfulsidebar.
Also it seems native icons (in 10.9 at least) have a gradient applied to them. @sassanh How did you arrive at the filter you used? Was it just trial and error or did you reverse engineer the one used by the finder?
from colorfulsidebar.
Well I'm on Sierra. Can't remember how I found that filter. I guess it should've been trial and error but I somehow feel I got certain that this is what Finder does itself.
from colorfulsidebar.
Interesting. I took a look into how dropbox does its code injection for the sidebar icon on mavericks (which looks and feels exactly like native) and it turns out that if you do [image setTemplate:true];
after the addRepresentation
then the OS automatically applies the appropriate shading and highlight.
After I did this the black->white invert when the sidebar item is selected worked (exactly like it does on native icons). I recommend you add this to your fork so it is even closer to native behavior.
The only odd/interesting thing is that even with [image setTemplate:true];
you still need to apply the lightening CIFilter, albeit not as much as before. With [image setTemplate:true];
I found via experimentation that [ciFilter setValue:[NSNumber numberWithFloat:.04] forKey:@"inputBrightness"];
closely matched native icons (on mavericks at least). I'm not sure why lightening is necessary even with the system template applied, but it might be due to a difference in how the image is loaded (the dropbox bundle did some weird thing creating a CGImage from a PNG CGDataProvider that allowed for playing around with some color space/upscaling options).
For further investigation might be the NSSidebarImage class in appkit that Finder (and many other cocoa apps leverage).
from colorfulsidebar.
Can you prepare a pull request for setTemplate: treu
?
from colorfulsidebar.
Alright done. See sassanh#1
from colorfulsidebar.
Related Issues (16)
- "Remote Disc" uses wrong icon, changes in icons10.plist without effect HOT 1
- No function @10.11.6 HOT 1
- colorfulSidebar crashes causing infinite login loop HOT 4
- Dealing with "deny file-read-data /path/to/icns" when injecting into sandboxed app HOT 7
- iCloud Drive icon stays blank HOT 17
- ColorfulSidebar 2.1.2 on mojave 10.14.6 cause error in Quicklook plugin for pdf files HOT 1
- Make it work on M1 Macs? HOT 3
- Different icon for highlighted sidebar icons? HOT 1
- plugin breaks unarchiving files HOT 3
- Is there any chance to get a colorful sidebar also in Sierra Mail app? HOT 4
- Any clues on why this isn't working on my machine? HOT 6
- VLC plural script does not work with macOS 10.12.6 (16G1114), when colorfulSidebar9 is installed. HOT 1
- Want to have custom but not colorful icons HOT 1
- persists after deinstallation? HOT 2
- Not Working with Mojave 10.14 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from colorfulsidebar.