I've tried just drawing this colour to a plain view, and I get no texture, just
a pale "chino" sort of colour. Looking at what I get from this method in the
debugger:
(NSColor *) $1 = 0x000000010983f850 NSCustomColorSpace sRGB IEC61966-2.1
colorspace 0.980392 0.941176 0.901961 1
This seems to be the colour I'm seeing. I would not really expect it to be in
the sRGB colorspace, but the real giveaway is this - if I ask this colour for
its -patternImage, it throws an exception, just as the documentation says it
will IF IT HAS NO PATTERN IMAGE. Something's gone wrong delivering this colour
to my app from the internals of Cocoa. But what?
2012-08-06 16:02:17.068 Artboard[22765:303] *** -patternImage not valid for the
NSColor NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0.980392 0.941176
0.901961 1; need to first convert colorspace.
2012-08-06 16:02:17.071 Artboard[22765:303] (
0 CoreFoundation 0x00007fff882e9716
__exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff8bfb5470
objc_exception_throw + 43
2 CoreFoundation 0x00007fff882e94ec
+[NSException raise:format:] + 204
3 AppKit 0x00007fff81b09948 -[NSColor
patternImage] + 66
My code:
NSColor* bkg = [NSColor underPageBackgroundColor];
NSImage* patImg = [bkg patternImage];
--Graham
On 04/08/2012, at 6:51 PM, Marcus Karlsson <[email protected]> wrote:
> I'm getting the pattern when I use it with -setBackgroundColor: on a
> scrollview. What do you get if you try it on an empty scrollview,
> perhaps in a new project just in case there's something else that
> prevents it from drawing?
>
> Marcus
>
_______________________________________________
Cocoa-dev mailing list ([email protected])
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 [email protected]