There are 16.5 million RGB combinations.
Are you looking for the "closest" match or an "exact" match ?
Exact match would probably have 100 pôssible solutions, eg. "add them up = concatenate" .
(0,0,0) is black, that becomes r & g & b = "000" and look if black "000" is in the table.
depending on the sqlite/ordering possibilities, you might want to add leading zeroes "000000000"
White string = "255255255"
If you want the closest match, that is a matter of color theory
Paul