Get RGB color code from object?

I’m trying to get the RGB colour code of an object that is extracted from a external source.

When I select the object and use rhino.objectcolor it returns a long string of numbers and I cant see what reference this has to an RGB code.

The Code below:

For each strObject in arrObject

If Rhino.IsSurface(strObject)

srfcolour = Rhino.ObjectColor(strObject)

End If

Next

The output I get for srfcolour = 11783547

I would prefer the return to be RGB(X,X,X) for example

Is this the color you expect:
rgb: 179,205,123

(just making sure I have the correct assumption that the color is being returned as an int)

I found this script while searching the RhinoScript docs:
https://developer.rhino3d.com/api/rhinoscript/sample_scripts/rgb_helpers.htm

This has worked! thanks so much!! works a treat now

1 Like