The 'color palette' is not assigned to a given object, but rather it's associated with a particular part file. That being said,
'UF_DISP_ask_closest_color_in_part' should return the color index (1-216) for an object when you pass this command the object's 'tag'. Generally speaking, you can find this index number, and thus the RGB values, in one of two ways. Inside of an NX session, you can go to...
Preferences -> Color Palettes...
...and at the bottom of the dialog, in the section labeled 'Options', select the 'Information' icon.
Or you can look at the CDF file specified at...
Customer Defaults -> gateway -> Visualization -> Color Palette
...but becareful because this does NOT necessarily represent the CDF file used in any particular part file, just the one that will be used if a new 'blank' part of created or will be used if you replace the CDF file in an open part with the current default, which can also be done from the 'Options' section of the Color Palette dialog. However, the scheme described above, selecting the 'Information' icon in the 'Options' section of the Color Palette dialog, will ALWAYS provide you the correct color data.
Not sure if this helps you all that much, but...
John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:
To an Engineer, the glass is twice as big as it needs to be.