Re: Deciding whether text should be black or white for a given background color
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