• 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: Keith Blount <email@hidden>
  • Date: Mon, 4 Dec 2006 11:16:19 -0800 (PST)

Great! Thank you very much, both of you, for your suggestions. -brightnessComponent seems to do exactly what I want, but I'll test to see how it looks with white text with a drop shadow (which is always a nice touch).
Thanks again,
Keith

----- Original Message ----
From: Ricky Sharp <email@hidden>
To: Alastair Houghton <email@hidden>
Cc: Keith Blount <email@hidden>; email@hidden
Sent: Monday, December 4, 2006 6:59:13 PM
Subject: Re: Deciding whether text should be black or white for a given background color


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)







____________________________________________________________________________________
Yahoo! Music Unlimited
Access over 1 million songs.
http://music.yahoo.com/unlimited
_______________________________________________

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

  • Prev by Date: Re: CFMessagePort problems
  • Next by Date: Re: Bindings: changing model changes some views but not others (NSTableColumn)
  • Previous by thread: Re: Deciding whether text should be black or white for a given background color
  • Next by thread: Fwd: Window menu not displaying open windows?
  • Index(es):
    • Date
    • Thread