NSColor contrasting color?
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