ozw1z5rd
ozw1z5rd

Reputation: 3208

SceneKit : how to change the color of an object

I read the docs from Apple and they say that the solution is inside UIKit; unfortunately, I'm not writing code for IOs but MacOS so no UIKit.

What is the correct object which allows me to change the color?

sphereGeometry.firstMaterial?.diffuse.contents = ??

Upvotes: 0

Views: 2297

Answers (1)

ozw1z5rd
ozw1z5rd

Reputation: 3208

I found the solution:

sphereGeometry.firstMaterial?.diffuse.contents = NSColor(calibratedRed: 0.3, green: 0.5, blue: 0.4, alpha: 1 )

NSColor is the object to use to get the job done.

Upvotes: 1

Related Questions