SCNMaterialProperty.Contents should be able to be set to a variety of objects, including CoreGraphics objects.
However, the binding forces NSObjects and thus prevent CGColor use.
The ContentColor binding forces you to use UIColor and doesn't support CGColor.
Similar problems occur for CGImage and the ContentImage binding.
These are important to support because SceneKit is multithreaded but the UIColor and UIImage classes are locked to the UI thread. For instance, thumbnail generation is usually done in a background thread but this cannot be done because of this binding.
This is also a bug on the Mac binding. Please fix both. :-)
(Also, the names are strange. Why is one pluralized "Contents", and the others are "Content"? I think the names should have been ColorContents not ContentColor since the color is the content, not an attribute of the content.)
Yes, it seems the API should accept an INativeObject (not an NSObject).
> UIColor and UIImage classes are locked to the UI thread.
The UIColor type is marked as [ThreadSafe] in our bindings and you should be able to use it in background threads. For UIImage it's not the entire API, but most members are marked as [ThreadSafe].
If you're hitting a case where that does not work please attach a test case as something (else) must be wrong and needs to be verified.
Thanks for the clarifications. The last time I tried to use a UIColor on a background thread it blew up with a Xamarin exception. But that might have been literally years ago. I've just taken it as doctrine. Nice to know it works!
@Frank - Here's a quick patch to hack in setting a CGColor: