• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Simple question? NSButton/checkbox color
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple question? NSButton/checkbox color


  • Subject: Re: Simple question? NSButton/checkbox color
  • From: "Gary L. Wade" <email@hidden>
  • Date: Fri, 06 Jun 2014 07:10:20 -0700

If I were colorizing such a button, I'd try overriding drawRect: and have the superclass draw in my own focused image, desaturate anything that's fully opaque (check boxes aren't necessarily rectangular nor "completely contained"), and then apply the desired color with a less-than-1.0 (25% maybe) alpha. After that I'd draw my focused image within the context that was given at the time my drawRect: was called. However, you would need to be careful to be sure whatever background color is present is preserved and also not tinted, and any shadows are correctly handled, and you'd need to handle any intermediate drawing states (including the actual check mark, whatever it may be) and retina issues that may come up.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >Simple question? NSButton/checkbox color (From: Alex Kac <email@hidden>)
 >Re: Simple question? NSButton/checkbox color (From: Alex Kac <email@hidden>)
 >Re: Simple question? NSButton/checkbox color (From: Lee Ann Rucker <email@hidden>)

  • Prev by Date: Re: Simple question? NSButton/checkbox color
  • Next by Date: Re: Simple question? NSButton/checkbox color
  • Previous by thread: Re: Simple question? NSButton/checkbox color
  • Next by thread: Re: Simple question? NSButton/checkbox color
  • Index(es):
    • Date
    • Thread