Use this way:
rgbcode= styleattr(objectinfo(selection.obj,2),2)
compr = rgbcode \ 65536
print "R = " +str$(compr)
compg=(rgbcode – compr * 65536) \ 256
print "G = " +str$(compg)
print "B = " +str$(rgbcode - compr * 65536 - compg * 256)
I found this explanation here: Colors and MapInfo written by Jacques Paris back in 2002
------------------------------
Peter Horsbøll Møller
Principal Presales Consultant | Distinguished Engineer
Precisely | Trust in Data
------------------------------