Best way to change the background color for an NSView

Posted by outtru.mp on Stack Overflow See other posts from Stack Overflow or by outtru.mp
Published on 2010-06-03T01:25:26Z Indexed on 2010/06/03 1:34 UTC
Read the original article Hit count: 645

I'm looking for the best way to change the background color of an NSView. I'd also like to be able to set the appropriate alpha mask for the NSView. Something like:

myView.backgroundColor = [NSColor colorWithCalibratedRed:0.227f green:0.251f blue:0.337 alpha:0.8];

I notice that NSWindow has this method, and I'm not a big fan of the NSColorWheel, or NSImage background options, but if they are the best, willing to use.

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about cocoa