• 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: Deciding whether text should be black or white for a given background color
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Deciding whether text should be black or white for a given background color


  • Subject: Re: Deciding whether text should be black or white for a given background color
  • From: Ricky Sharp <email@hidden>
  • Date: Mon, 04 Dec 2006 10:59:13 -0800

On Monday, December 04, 2006, at 11:46AM, "Alastair Houghton" <email@hidden> wrote:
>On 4 Dec 2006, at 17:36, Keith Blount wrote:
>
>> So, my question is, is there a simple way of deciding whether black
>> or white provides the best contrast for any given NSColor?
>
>An easy way is to call -brightnessComponent on your NSColor and use
>that to make the decision.

Two other potential solutions:

(a) stroke the black-filled font with white (basically what cursor images often do)

(b) use white text with a drop shadow (what the Dock does)

--
Rick Sharp
Instant Interactive(tm)

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: 
 >Deciding whether text should be black or white for a given background color (From: Keith Blount <email@hidden>)
 >Re: Deciding whether text should be black or white for a given background color (From: Alastair Houghton <email@hidden>)

  • Prev by Date: Re: Synchronizing Thread Execution
  • Next by Date: Re: CFMessagePort problems
  • Previous by thread: Re: Deciding whether text should be black or white for a given background color
  • Next by thread: Re: Deciding whether text should be black or white for a given background color
  • Index(es):
    • Date
    • Thread