• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: +underPageBackgroundColor
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: +underPageBackgroundColor


  • Subject: Re: +underPageBackgroundColor
  • From: Graham Cox <email@hidden>
  • Date: Mon, 06 Aug 2012 16:06:17 +1000

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@hidden> 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@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

  • Follow-Ups:
    • Re: +underPageBackgroundColor
      • From: Kevin Perry <email@hidden>
References: 
 >+underPageBackgroundColor (From: Graham Cox <email@hidden>)
 >Re: +underPageBackgroundColor (From: "Gary L. Wade" <email@hidden>)
 >Re: +underPageBackgroundColor (From: Graham Cox <email@hidden>)

  • Prev by Date: makeFirstResponder: and tab views
  • Next by Date: setting font
  • Previous by thread: Re: +underPageBackgroundColor
  • Next by thread: Re: +underPageBackgroundColor
  • Index(es):
    • Date
    • Thread