• 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: White caret cursor, how to do it?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: White caret cursor, how to do it?


  • Subject: Re: White caret cursor, how to do it?
  • From: "I. Savant" <email@hidden>
  • Date: Mon, 20 Mar 2006 11:14:13 -0500


So what I guess I'm meaning here is the "color complement", according to John's reply. Is there an easy way of getting the complement of a given NSColor? I don't see anything obvious in the API docs.


--
I.S.


On Mar 20, 2006, at 10:43 AM, John C. Randolph wrote:


On Mar 20, 2006, at 6:00 AM, Camillo Lugaresi wrote:

On 20/mar/06, at 14:06, I. Savant wrote:

Excellent post, Dominik and thanks for the answer Greg.

Along these lines, I have another question. How can you easily get the "opposite" color for the background color? In other words, how do we get the best contrasting color for a given background color?

That's not quite the same thing. The opposite of red is green, but red on green is unreadable to color-blind people, and red on white or black looks more contrasted to anyone. For text, I'd just take the color's brightness, and use black if it's above 50%, otherwise white. You might want to adjust the threshold depending on which of the two colors is going to be the background.

Actually, the color complement to red is cyan, not green.

-jcr

John C. Randolph <email@hidden> (408) 914-0013
Roaming Cocoa Engineer,
Available for your projects at great Expense and Inconvenience.




_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: White caret cursor, how to do it?
      • From: "John C. Randolph" <email@hidden>
References: 
 >Re: White caret cursor, how to do it? (From: Greg Herlihy <email@hidden>)
 >Re: White caret cursor, how to do it? (From: "I. Savant" <email@hidden>)
 >Re: White caret cursor, how to do it? (From: Camillo Lugaresi <email@hidden>)
 >Re: White caret cursor, how to do it? (From: "John C. Randolph" <email@hidden>)

  • Prev by Date: Re: NSTableView: displaying number of selected rows (error with image)
  • Next by Date: How to split a big file ?
  • Previous by thread: Re: White caret cursor, how to do it?
  • Next by thread: Re: White caret cursor, how to do it?
  • Index(es):
    • Date
    • Thread