Last active
August 29, 2015 14:12
-
-
Save typemytype/658edbd3393a3c90b203 to your computer and use it in GitHub Desktop.
creates a pink app icon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from AppKit import * | |
icon = NSApp().applicationIconImage() | |
w, h = icon.size() | |
new = NSImage.alloc().initWithSize_((w, h)) | |
imageRect = NSMakeRect(0, 0, w, h) | |
new.lockFocus() | |
icon.drawInRect_(imageRect) | |
NSColor.magentaColor().set() | |
NSRectFillUsingOperation(imageRect, NSCompositeSourceAtop) | |
icon.drawInRect_fromRect_operation_fraction_(imageRect, imageRect, NSCompositePlusLighter, 1) | |
new.unlockFocus() | |
NSApp().setApplicationIconImage_(new) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment