Hello,

I'm posting this here because quartz-dev seems dead. I have a layer hosting view where I use a -compositingFilter with a CIColorBlendMode filter (default settings). It's constructed and applied to the layer like this:

    CIFilter *cf = [CIFilter filterWithName:@"CIColorBlendMode"];
    [cf setDefaults];
    [overlayLayer setCompositingFilter:cf];

overlayLayer is z-ordered above another layer that has a grayscale content (a height field). I draw colors into the overlayLayer which in turn colorizes the height field. Works fine but some colors give me grieve in that the hue is completely wrong and I have no idea why.

To illustrate the problem I've uploaded an annotated screenshot here:

http://www.shiftoption.com/temp/blendingtrouble.png

It shows both the colors used (upper rect) and blended result (lower rect). The upper screen shot is for two colors that "work". The lower is for a color that doesn't (color C). The difference between the two is saturation, 0.1 works, 0.003 doesn't (in case you wonder, 0.004 works).

So, these work:
[NSColor colorWithCalibratedHue:0.55 saturation:0.1 brightness:1.0 alpha:1.0]
[NSColor colorWithCalibratedHue:1.0 saturation:0.8 brightness:0.8 alpha:1.0]

This one doesn't:
[NSColor colorWithCalibratedHue:0.55 saturation:0.003 brightness:1.0 alpha:1.0]

I don't have the slightest idea why the hue changes so dramatically. Maybe this is to be expected? Why? Can I avoid that? How?

Any tips greatly appreciated!

Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________

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