We have a table DIM_ESHOP_PHONE, containing a column Color_RGB in RGB Hex Format . We want to reduce the color to a given palette of colors, contained into the table DIM_COLOR . We simply associate the RGB code to the palette using the minimal cartesian 3d distance , defined as
POWER( Power((R-Ro),2)+Power((G-Go),2)+Power((B-Bo),2) , 0.5) .
It works.