• 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
NSColor contrasting color?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSColor contrasting color?


  • Subject: NSColor contrasting color?
  • From: Martin Hewitson <email@hidden>
  • Date: Sat, 15 Sep 2012 10:52:11 +0200

Dear list,

I'm not sure what the correct terminology is here. I have a text editor app and the user can set the background color of the editor. The user can also set the line length for wrapping. Past that length, I have been drawing a shaded rect (in the text view subclass' -drawViewBackgroundInRect:). For the shaded rect, I've been using NSColor's shadowWithLevel:. This works fine for most colors, but obviously not for a black background.  I suppose in some cases I could highlightWithLevel and in others shadowWithLevel, but I don't know how to distinguish between these cases. Is there something else I could do to get a reasonable contrasting color?

Many thanks,

Martin








_______________________________________________

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

  • Follow-Ups:
    • Re: NSColor contrasting color?
      • From: Markus Spoettl <email@hidden>
  • Prev by Date: Re: Dynamic Method Creation
  • Next by Date: Re: Dynamic Method Creation
  • Previous by thread: Re: Dynamic Method Creation
  • Next by thread: Re: NSColor contrasting color?
  • Index(es):
    • Date
    • Thread