:\ I think I have it figured out
All colors work except white and black. I had to detect those and build the rgb manually On Jun 11, 2011, at 4:12 PM, Development wrote: > According to all the examples I have found the following code should give me > the RGB components of any UIColor.CGColor I pass to it.... > > However I get back a scrambled and often inaccurate array of color values > which turns out to be useless. > > CGFloat colors[[widgetArray count]*4]; > > > > id * item; > int idx=0; > for (item in widgetArray) { > > > > const CGFloat *comp = > CGColorGetComponents(item.backgroundColor.CGColor); > const CGFloat *c = CGColorGetComponents(item.backgroundColor.CGColor); > > colors[idx] = comp[0]; > > colors[++idx] = comp[1]; > > colors[++idx] = comp[2]; > > colors[++idx] = > c[CGColorGetNumberOfComponents(item.backgroundColor.CGColor)-1]; > > idx++; > > }_______________________________________________ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > 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: > http://lists.apple.com/mailman/options/cocoa-dev/development%40fornextsoft.com > > This email sent to developm...@fornextsoft.com _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com