Re: CALayer compositingFilter trouble
Re: CALayer compositingFilter trouble
- Subject: Re: CALayer compositingFilter trouble
- From: David Duncan <email@hidden>
- Date: Thu, 26 Apr 2012 09:50:18 -0700
On Apr 26, 2012, at 9:12 AM, Markus Spoettl wrote:
> I'm posting this here because quartz-dev seems dead.
Quartz-Dev may be quiet, but it doesn't seem dead to me :).
> 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?
My best guess would be you are underflowing. 1/255 = ~0.0039. 0.004 * 255 = 1, 0.003 * 255 = 0. Since the saturation determines how much of the hue contributes to the final color, if it is 0 you end up with a grayscale color based on brightness.
--
David Duncan
_______________________________________________
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