The _RGB function returns the closest palette index or 32 bit color value.
colorindex = _RGB(red, green, blue[, image_handle])