rem: panel->color.rgb.red   = panel->customPaletteImg->data[0][ofs]; panel->color.rgb.green = panel->customPaletteImg->data[1][ofs]; panel->color.rgb.blue  = panel->customPaletteImg->data[2][ofs];
add: panel->color.rgb.red   = panel->customPaletteImg->data[ofs]; panel->color.rgb.green = panel->customPaletteImg->data[ofs+1]; panel->color.rgb.blue  = panel->customPaletteImg->data[ofs+2];
context: customPalettePositionSelection(W_ColorPanel *panel, int x, int y){    W_Screen 		*scr = WMWidgetScreen(panel->win);    unsigned long	ofs;            /* undraw selection */    XCopyArea(scr->display, panel->selectionBackImg, 	      panel->customPaletteContentView->window, scr->copyGC, 0, 0, 4, 4, 	      panel->palx-2, panel->paly-2);        panel->palx = x;    panel->paly = y;        ofs = rint(x * panel->palXRatio) + rint(y * panel->palYRatio) * 	panel->customPaletteImg->width;        panel->color.rgb.red   = panel->customPaletteImg->data[0][ofs];    panel->color.rgb.green = panel->customPaletteImg->data[1][ofs];    panel->color.rgb.blue  = panel->customPaletteImg->data[2][ofs];    panel->color.set = cpRGB;        updateSwatch(panel, panel->color);    panel->lastChanged = WMCustomPaletteModeColorPanel;        /* Redraw color selector (and make a backup of the part it will cover) */    XCopyArea(scr->display, panel->customPaletteContentView->window, 	      panel->selectionBackImg, scr->copyGC, panel->palx-2, panel->paly-2, 	      4, 4, 0, 0);	/* "-2" is correction for hotspot location */    XCopyArea(scr->display, panel->selectionImg, 	      panel->customPaletteContentView->window, scr->copyGC, 0, 0, 4, 4, 	      panel->palx-2, panel->paly-2);	/* see above */}