BCGControlBar Pro for MFC
void CBCGPColorDialog::SetNewColor ( COLORREF  rgb)

Given an RGB value looks for a nearest color in the current palette and makes it the current selected color

Parameters
rgbAn RGB color value