Skip to content

Instantly share code, notes, and snippets.

@typemytype
Last active August 29, 2015 14:12
Show Gist options
  • Save typemytype/658edbd3393a3c90b203 to your computer and use it in GitHub Desktop.
Save typemytype/658edbd3393a3c90b203 to your computer and use it in GitHub Desktop.
creates a pink app icon
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