Look like smokris set it up to use CGColorSpace, which is probably smart and 
pragmatic, by making a method ala:

CGColorRef CGColorWithNSColor(NSColor *nsc)
{
    CGFloat components[4];
    [nsc getComponents:(CGFloat *)&components];
    return (CGColorRef)CGColorCreate([[nsc colorSpace] CGColorSpace], 
components);
}


-gt


On Jul 21, 2013, at 2:15 AM, CoGe - Tamas Nagy <[email protected]> wrote:

> What you want. Probably [image imageColorSpace] is the best choice
> 
> On Jul 21, 2013, at 8:12 AM, George Toledo <[email protected]> wrote:
> 
>> I guess that's cool...device color space is what to use there?
>> 
>> On Jul 21, 2013, at 2:10 AM, CoGe - Tamas Nagy <[email protected]> wrote:
>> 
>>> Why don't just convert the NSColor to CGColor?
>>> 
>>>                     CGFloat colorComponents[4];
>>>                     [[NSColor redColor] 
>>> colorUsingColorSpaceName:NSDeviceRGBColorSpace] 
>>> getComponents:colorComponents];
>>>                     
>>>                     // Create the CGColor
>>>                     CGColorRef myCGColor =
>>>                     (id)CGColorCreateGenericRGB(
>>>                                                              
>>> colorComponents[0],
>>>                                                              
>>> colorComponents[1],
>>>                                                              
>>> colorComponents[2],
>>>                                                              
>>> colorComponents[3])
>>>                                  ;
>>> 
>>> 
>>> On Jul 20, 2013, at 9:28 PM, George Toledo <[email protected]> wrote:
>>> 
>>>> That's what I'm seeing - differences between the color port stuff/NSColor 
>>>> in 10.8 and previous…the ARC part is spurious.
>>>> 
>>>> Haven't dealt with this before…
>>>> 
>>>> Perhaps you can do something like this right after your imports in your 
>>>> QCColourArtPlugin.m or make a separate file and import that ala 
>>>> https://gist.github.com/msanders/707921
>>>> 
>>>> #import <AppKit/AppKit.h>
>>>>  
>>>> @interface NSColor (CGColor)
>>>>  
>>>> //
>>>> // The Quartz color reference that corresponds to the receiver's color.
>>>> //
>>>> @property (nonatomic, readonly) CGColorRef CGColor;
>>>>  
>>>> //
>>>> // Converts a Quartz color reference to its NSColor equivalent.
>>>> //
>>>> + (NSColor *)colorWithCGColor:(CGColorRef)color;
>>>>  
>>>> @end
>>>> 
>>>> That said, I can't get your plugin to compile because I'm missing 
>>>> "Ports.plist"
>>>> 
>>>> -gt
>>>> 
>>>> On Jul 20, 2013, at 2:52 PM, "Chris (CoreGraphics) Wright" 
>>>> <[email protected]> wrote:
>>>> 
>>>>> Are you just getting errors regarding NSColor?  If not, can you post the 
>>>>> error messages you're receiving?
>>>>> 
>>>>> I just see some NSColor stuff, and that's because -[NSColor CGColor] was 
>>>>> added in 10.8, so it wouldn't be available in 10.7.  ARC complains about 
>>>>> this because it doesn't know how ownership works for the returned thing 
>>>>> since the method doesn't exist as far as it's concerned.
>>>>> 
>>>>> https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSColor_Class/Reference/Reference.html
>>>>> 
>>>>> --
>>>>> Christopher Wright
>>>>> [email protected]
>>>>> 
>>>>> 
>>>>> On Jul 20, 2013, at 10:58 AM, Jonathan Hammond <[email protected]> 
>>>>> wrote:
>>>>> 
>>>>>> Hi guys i've got a QC plugin that works out the primary colours of an 
>>>>>> image like iTunes. I'm truing to build it for 10.7, each time i change 
>>>>>> the build targets I get ARC Semantic Issues, i'm not a Obj C guys and am 
>>>>>> very confused about how to fix this. Could anyone help 
>>>>>> 
>>>>>> The Source is located here 
>>>>>> https://dl.dropboxusercontent.com/u/31564678/QCColourArt%202.zip
>>>>>> 
>>>>>> Much thanks
>>>>>> 
>>>>>> J
>>>>>> _______________________________________________
>>>>>> Do not post admin requests to the list. They will be ignored.
>>>>>> Quartzcomposer-dev mailing list      ([email protected])
>>>>>> Help/Unsubscribe/Update your Subscription:
>>>>>> https://lists.apple.com/mailman/options/quartzcomposer-dev/christopher_wright%40apple.com
>>>>>> 
>>>>>> This email sent to [email protected]
>>>>> 
>>>>> _______________________________________________
>>>>> Do not post admin requests to the list. They will be ignored.
>>>>> Quartzcomposer-dev mailing list      ([email protected])
>>>>> Help/Unsubscribe/Update your Subscription:
>>>>> https://lists.apple.com/mailman/options/quartzcomposer-dev/gtoledo3%40gmail.com
>>>>> 
>>>>> This email sent to [email protected]
>>>> 
>>>> _______________________________________________
>>>> Do not post admin requests to the list. They will be ignored.
>>>> Quartzcomposer-dev mailing list      ([email protected])
>>>> Help/Unsubscribe/Update your Subscription:
>>>> https://lists.apple.com/mailman/options/quartzcomposer-dev/info%40cogevj.hu
>>>> 
>>>> This email sent to [email protected]
>>> 
>>> Tamas Nagy | Software Developer - CoGe VJ Software 
>>> www.cogevj.hu | www.facebook.com/cogevj | www.twitter.com/lumabeamerz
>>>     
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
> 
> Tamas Nagy | Software Developer - CoGe VJ Software 
> www.cogevj.hu | www.facebook.com/cogevj | www.twitter.com/lumabeamerz
>       
> 
> 
> 
> 
> 
> 
> 
> 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to