Re: hueComponent not valid for the NSColor
Re: hueComponent not valid for the NSColor
- Subject: Re: hueComponent not valid for the NSColor
- From: Torsten Curdt <email@hidden>
- Date: Sat, 01 Nov 2014 22:05:03 +0100
> It's a color space that only contains a white and alpha component. Hue
doesn't make sense in an all white space. It's like if we were talking
about a train that only goes between NYC and DC, and you asked "How long
does it take for that train to reach London?" You can't ask that question
because the train doesn't go there. It doesn't have that degree of freedom.
>
> Your second example has white in a RGB color space. That does have the
freedom to give you hue.
Thanks for very simplified explanation :)
This works:
NSColor *base = [[NSColor whiteColor]
colorUsingColorSpace:[NSColorSpace genericRGBColorSpace]];
NSColor *stroke = [NSColor colorWithCalibratedHue:base.hueComponent
saturation:base.saturationComponent
brightness:0.4
alpha:base.alphaComponent];
Guess my real question is:
Why is "whiteColor" not in RGB while "redColor" is?
Just because is doesn't have to?
Don't see it in the docs either.
cheers,
Torsten
_______________________________________________
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