> On Jan 1, 2015, at 1:25 PM, Eden Smallwood <zeppenw...@lafn.org> wrote:
> 
>       If you’re thinking "Wh on Bk and Bk on Wh, therefore XOR to the 
> rescue", I’ve tried every conceivable setting of cgBlendMode and 
> nsCompositingMode and nothing has any effect whatsoever on the text color 
> which results in the window.

XOR-based drawing modes are pretty much useless in anything other than 1-bit 
(b/w) graphics. I don't think CG even supports them.

>       Or perhaps it’s possible to detect the “background color” of the 
> current CGContext or NSContext?  But this notion doesn’t seem to exist. 

I don't think so. The individual calls don't draw both foreground and 
background, so the background is simply the color of the pixels that already 
exist in the buffer at the time you're drawing. Or of the pixels your pixmap 
will be composited onto when it's drawn, if it's transparent.

I don't know much about QuickLook generators, but it looks like there are a lot 
of possible data types that the generator can return the preview as, including 
textual ones like RTF. If so, it's possible the preview you saw is textual and 
the Finder is overriding its text styling to force a contrasting color.

—Jens
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to