Matt Legend Gemmell Modesty is Lying

Mac OS X Cocoa and iPhone Development Services available at Instinctive Code.
Favorites icon
Favorites for iPhone
Speed-dial with style.
Mac OS X Cocoa and iPhone Developer for hire

Other Pages

Categories

Setting the text color of an NSButton

I wrote a little category on NSButton tonight to allow getting/setting the color of the label text, e.g. on checkboxes and such. Handy for putting controls in HUD Windows, where you’ll usually want white text instead of the default black.
Since the code is so short, I decided to make it the inaugural entry on pastebuffer.com, [...]


NSColor+ContrastingLabelExtensions

A quick Cocoa source code post. This one is simple: it’s a category on NSColor which returns another NSColor for use when drawing label text on top of the receiver. Either white or black is returned, depending on which will have most visual contrast with the receiver’s color. In the event of the receiver’s colorspace [...]